Re: Increasing GROUP BY CHAR columns speed - Mailing list pgsql-performance

From Scott Marlowe
Subject Re: Increasing GROUP BY CHAR columns speed
Date
Msg-id dcc563d10811281024l4cc3a063r4f17ba8337b1ee36@mail.gmail.com
Whole thread Raw
In response to Re: Increasing GROUP BY CHAR columns speed  ("Andrus" <kobruleht2@hot.ee>)
Responses Re: Increasing GROUP BY CHAR columns speed
List pgsql-performance
On Fri, Nov 28, 2008 at 10:58 AM, Andrus <kobruleht2@hot.ee> wrote:
>
> SET work_mem = 2097151  (this is max allowed value) or SET work_mem = 97151
> decreases query time from 12 seconds to 9 seconds.

Setting work_mem so high that it allocates memory that isn't there
WILL slow down your queries, because the OS will then wind up swapping
out one part of the swap to make room for another part.  There are
values between 100M and 2G.  Run it with increasing work_mem from 100
to 500 or so Meg and see if that helps.  Keep an eye on vmstat 1 or
something to see if your machine starts swapping out while running the
query.  If it does you've overallocated memory and things will start
to slow down a LOT.

pgsql-performance by date:

Previous
From: "Andrus"
Date:
Subject: Re: Increasing GROUP BY CHAR columns speed
Next
From: Scott Carey
Date:
Subject: Re: Increasing GROUP BY CHAR columns speed