Re: Speeding up DELETEs on table with FKs ...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Speeding up DELETEs on table with FKs ...
Date: 2004-10-10 22:45:02
Message-ID: 19212.1097448302@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Marc G. Fournier" <scrappy(at)postgresql(dot)org> writes:
> I posted to -sql the other day about an atrociously slow DELETE on a table
> that has two FKs to a 'parent' table ... if the # of records in the table
> that match the condition is 1, its fast ... in the sample I'm working
> with, there are 1639 records in the table ...

"parent" table? A DELETE doesn't check FKs in the table it's deleting.
What it checks are FKs in other tables that reference items in the
deletion table. You sure you are worrying about the right set of FKs?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dan Libby 2004-10-10 22:46:21 Re: Status ofTrigger Firing Order and 'FOR EACH STATEMENT'?
Previous Message Tom Lane 2004-10-10 22:37:28 Re: cvs tip broken build for plpython