pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Karim Nassar <karim.nassar@NAU.EDU>
Cc: pgsql-performance@postgreSQL.org
Subject: Re: Delete query takes exorbitant amount of time
Date: Thu, 24 Mar 2005 20:48:38 -0500
Message-ID: <3750.1111715318@sss.pgh.pa.us> (raw)
In-Reply-To: <1111715131.9085.174.camel@k2.cet.nau.edu>
References: <1111709457.9085.127.camel@k2.cet.nau.edu>
	<2630.1111711927@sss.pgh.pa.us>
	<1111715131.9085.174.camel@k2.cet.nau.edu>

Karim Nassar <karim.nassar@NAU.EDU> writes:
>> Look at what your triggers are doing.  My private bet is that you have
>> unindexed foreign keys referencing this table, and so each deletion
>> forces a seqscan of some other, evidently very large, table(s).

> Almost. I have a large table (6.3 million rows) with a foreign key
> reference to this one (which has 749 rows), however it is indexed. 

In that case there's a datatype mismatch between the referencing and
referenced columns, which prevents the index from being used for the
FK check.

			regards, tom lane



view thread (60+ messages)  latest in thread

Message-ID: <3750.1111715318@sss.pgh.pa.us>
Permalink:  ../3750.1111715318@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3750.1111715318@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-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, karim.nassar@NAU.EDU
  Subject: Re: Delete query takes exorbitant amount of time
  In-Reply-To: <3750.1111715318@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