pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Richard Broersma Jr <rabroersma@yahoo.com>
Cc: Bryce Nesbitt <bryce1@obviously.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Very slow DELETE on 4000 rows of 55000 row table
Date: Thu, 05 Apr 2007 01:23:50 -0400
Message-ID: <19114.1175750630@sss.pgh.pa.us> (raw)
In-Reply-To: <880852.63314.qm@web31801.mail.mud.yahoo.com>
References: <880852.63314.qm@web31801.mail.mud.yahoo.com>

Richard Broersma Jr <rabroersma@yahoo.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



view thread (5+ messages)

Message-ID: <19114.1175750630@sss.pgh.pa.us>
Permalink:  ../19114.1175750630@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19114.1175750630@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, rabroersma@yahoo.com, bryce1@obviously.com
  Subject: Re: Very slow DELETE on 4000 rows of 55000 row table
  In-Reply-To: <19114.1175750630@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox