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

From Stephan Szabo
Subject Re: NOT IN query takes forever
Date
Msg-id 20040803065928.Y88907@megazone.bigpanda.com
Whole thread Raw
In response to NOT IN query takes forever  (Marius Andreiana <mandreiana@rdslink.ro>)
List pgsql-performance
On Tue, 3 Aug 2004, Marius Andreiana wrote:

> I just vacuum analyse'd the database.
>
> 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).
>
> My postgresql.conf is the default:
> # - Memory -
>
> shared_buffers = 1000           # min 16, at least max_connections*2,
> 8KB each
> #sort_mem = 1024                # min 64, size in KB
> #vacuum_mem = 8192              # min 1024, size in KB
>
> Should I adjust something?

Probably sort_mem.  It's probably estimating that it can't hash the result
into the 1MB of sort_mem so it's probably falling back to some sort of
nested execution.


pgsql-performance by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: NOT IN query takes forever
Next
From: "Matthew T. O'Connor"
Date:
Subject: Re: pg_autovacuum parameters