Re: Delete query takes exorbitant amount of time - Mailing list pgsql-performance

From Tom Lane
Subject Re: Delete query takes exorbitant amount of time
Date
Msg-id 3750.1111715318@sss.pgh.pa.us
Whole thread Raw
In response to Delete query takes exorbitant amount of time  (Karim Nassar <Karim.Nassar@acm.org>)
Responses Re: Delete query takes exorbitant amount of time
Re: Delete query takes exorbitant amount of time
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Karim Nassar
Date:
Subject: Re: Delete query takes exorbitant amount of time
Next
From: Tom Lane
Date:
Subject: Re: Delete query takes exorbitant amount of time