Re: Very slow DELETE on 4000 rows of 55000 row table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
Cc: Bryce Nesbitt <bryce1(at)obviously(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Very slow DELETE on 4000 rows of 55000 row table
Date: 2007-04-05 05:23:50
Message-ID: 19114.1175750630@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Richard Broersma Jr <rabroersma(at)yahoo(dot)com> writes:
>> But I DELETE all conflicting those rows prior to the slow DELETE, just
>> so the FK check is never hit. Should I be looking at subverting the FK
>> check mechanism somehow? The necessary index would be huge, and
>> relevant only on this particular operation which happens every few
>> months, if that.

> true, but without an index, it still has to scan the table just to be sure.

If this is only a once-in-awhile thing, maybe you could build the index,
do the deletes, drop the index ...

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2007-04-05 05:27:25 Re: slow query
Previous Message A. Kretschmer 2007-04-05 05:11:27 Re: slow query