Skip site navigation (1) Skip section navigation (2)

Re: Delete query takes exorbitant amount of time

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Karim Nassar <karim(dot)nassar(at)NAU(dot)EDU>
Cc: pgsql-performance(at)postgreSQL(dot)org
Subject: Re: Delete query takes exorbitant amount of time
Date: 2005-03-25 01:48:38
Message-ID: 3750.1111715318@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Karim Nassar <karim(dot)nassar(at)NAU(dot)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

In response to

Responses

pgsql-performance by date

Next:From: Tom LaneDate: 2005-03-25 02:32:56
Subject: Re: Delete query takes exorbitant amount of time
Previous:From: Karim NassarDate: 2005-03-25 01:48:24
Subject: Re: Delete query takes exorbitant amount of time

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group