Re: Exploring memory usage

From: Claudio Freire <klaussfreire(at)gmail(dot)com>
To: Michael Smolsky <sitrash(at)email(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Exploring memory usage
Date: 2011-12-27 15:33:30
Message-ID: CAGTBQpZtS-2cTWV9meyimTtbzm-UkPAaeaM2vyt=h-GO-9-6nQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Sat, Dec 24, 2011 at 4:22 PM, Michael Smolsky <sitrash(at)email(dot)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>

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Marlowe 2011-12-27 16:00:20 Re: Exploring memory usage
Previous Message MirrorX 2011-12-27 14:21:02 Re: parse - bind take more time than execute