Hello All,
TL> If you're deleting very many but not all rows, people tend
TL> to drop the FK constraints and re-establish them afterwards.
I find
BEGIN;
CREATE TEMP TABLE remnant AS
SELECT * FROM bigtable WHERE (very_restrictive_condition);
TRUNCATE TABLE bigtable;
INSERT INTO bigtable SELECT * FROM remnant;
COMMIT;
ANALYSE bigtable;
works well because there is no possibility of my forgetting FKs.
--
Sincerely,
Andrew Lazarus mailto:andrew@pillette.com