Re: NOT IN query takes forever - Mailing list pgsql-performance

From Merlin Moncure
Subject Re: NOT IN query takes forever
Date
Msg-id 6EE64EF3AB31D5448D0007DD34EEB34101AF1A@Herge.rcsinc.local
Whole thread Raw
In response to NOT IN query takes forever  (Marius Andreiana <mandreiana@rdslink.ro>)
Responses Re: NOT IN query takes forever
Re: NOT IN query takes forever
Re: NOT IN query takes forever
List pgsql-performance
> Trying to run this query:
> EXPLAIN ANALYSE
> select * FROM trans
> WHERE query_id NOT IN (select query_id FROM query)
>
> but it will remain like that forever (cancelled after 30 min).

explain analyze actually runs the query to do timings.  Just run explain
and see what you come up with.  More than likely there is a nestloop in
there which is causing the long query time.

Try bumping up shared buffers some and sort mem as much as you safely
can.

Merlin

pgsql-performance by date:

Previous
From: "Lending, Rune"
Date:
Subject: pg_autovacuum parameters
Next
From: Stephan Szabo
Date:
Subject: Re: NOT IN query takes forever