Re: High cost of ... where ... not in (select ...) - Mailing list pgsql-performance

From Tom Lane
Subject Re: High cost of ... where ... not in (select ...)
Date
Msg-id 14283.1245211578@sss.pgh.pa.us
Whole thread Raw
In response to Re: High cost of ... where ... not in (select ...)  (Aaron Turner <synfinatic@gmail.com>)
List pgsql-performance
Aaron Turner <synfinatic@gmail.com> writes:
> I know the costs are just relative, but I assumed
> cost=19229.08..29478.99 isn't 5 minutes of effort even on crappy
> hardware.

Very likely the bulk of the time is spent in the DELETE work proper,
not in the query to find the rows to be deleted.  In particular I wonder
if you have an unindexed foreign key referencing this table ...

            regards, tom lane

pgsql-performance by date:

Previous
From: Bryce Ewing
Date:
Subject: Index Scan taking long time
Next
From: Robert Haas
Date:
Subject: Re: Yet another slow nested loop