Re: Allow sorts to use more available memory

From: Andy Colson <andy(at)squeakycode(dot)net>
To: sthomas(at)peak6(dot)com
Cc: Robert Schnabel <schnabelr(at)missouri(dot)edu>, pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Allow sorts to use more available memory
Date: 2011-09-12 18:02:44
Message-ID: 4E6E4944.1010800@squeakycode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 9/12/2011 12:57 PM, Shaun Thomas wrote:
> On 09/12/2011 12:47 PM, Andy Colson wrote:
>
>> work_mem is not the total a query can use. I believe each step can
>> use that much, and each backend can use it for multiple bits. So if
>> you had two backends, each doing 2 sorts, you'd use 2*2 = 4 * 2GB =
>> 8GB.
>
> Exactly. Find a big query somewhere in your system. Use EXPLAIN to
> examine it.

Yeah, and even better, on PG 9, if you EXPLAIN ANALYZE it'll show you
just how much memory is actually being used.

-Andy

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Robert Schnabel 2011-09-12 18:22:51 Re: Allow sorts to use more available memory
Previous Message Shaun Thomas 2011-09-12 17:57:58 Re: Allow sorts to use more available memory