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

From Merlin Moncure
Subject Re: NOT IN query takes forever
Date
Msg-id 6EE64EF3AB31D5448D0007DD34EEB34101AF1C@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
List pgsql-performance
> > Try bumping up shared buffers some and sort mem as much as you
safely
> > can.
> Thank you, that did it!
>
> With
> shared_buffers = 3000        # min 16, at least max_connections*2,
8KB
> each
> sort_mem = 128000        # min 64, size in KB
>
> it takes <3 seconds (my hardware is not server-class).

Be careful...sort_mem applies to each connection and (IIRC) in some
cases more than once to a connection.  Of all the configuration
parameters, sort_mem (IMO) is the most important and the hardest to get
right.  128k (or 128MB) is awfully high unless you have a ton of memory
(you don't) or you are running in single connection scenarios.  Do some
experimentation by lowering the value until you get a good balance
between potential memory consumption and speed.

Merlin

pgsql-performance by date:

Previous
From: Marius Andreiana
Date:
Subject: Re: NOT IN query takes forever
Next
From: Gaetano Mendola
Date:
Subject: Re: pg_autovacuum parameters