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