Re: Exploring memory usage - Mailing list pgsql-performance

From Claudio Freire
Subject Re: Exploring memory usage
Date
Msg-id CAGTBQpZtS-2cTWV9meyimTtbzm-UkPAaeaM2vyt=h-GO-9-6nQ@mail.gmail.com
Whole thread Raw
In response to Exploring memory usage  ("Michael Smolsky" <sitrash@email.com>)
Responses Re: Exploring memory usage
List pgsql-performance
On Sat, Dec 24, 2011 at 4:22 PM, Michael Smolsky <sitrash@email.com> wrote:
> work_mem = 128MB (tried 257MB, didn't change anything)

This is probably your problem.

Without an EXPLAIN output, I cannot be sure, but 'work_mem' is not the
total amount of memory a query can use, it's the amount of memory it
can use for *one* sort/hash/whatever operation. A complex query can
have many of those, so your machine is probably swapping due to
excessive memory requirements.

Try *lowering* it. You can do so only for that query, by executing:

set work_mem = '8MB'; <your query>

pgsql-performance by date:

Previous
From: MirrorX
Date:
Subject: Re: parse - bind take more time than execute
Next
From: Scott Marlowe
Date:
Subject: Re: Exploring memory usage