Perry Smith <pedz@xxxxxxxxxxxxxxxx> writes: > Currently I have one table that mimics a file system. Each entry has a parent_id and a base name where parent_id is an id in the table that must exist in the table or be null with cascade on delete. > I’ve started a delete of a root entry with about 300,000 descendants. The table currently has about 22M entries and I’m adding about 1600 entries per minute still. Eventually there will not be massive amounts of entries being added and the table will be mostly static. The most obvious question is do you have an index on the referencing column. PG doesn't require one to exist to create an FK; but if you don't, deletes of referenced rows had better be uninteresting to you performance-wise, because each one will cause a seqscan. regards, tom lane