pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <scott.marlowe@gmail.com>
To: Justin Graf <justin@magwerks.com>
Cc: pgsql-performance@postgresql.org
Cc: anton200@gmail.com
Subject: Re: How exactly PostgreSQL allocates memory for its needs?
Date: Wed, 10 Feb 2010 20:46:52 -0700
Message-ID: <dcc563d11002101946o36d022e6me20c65cfff81b894@mail.gmail.com> (raw)
In-Reply-To: <4B72E23F.9040005@magwerks.com>
References: <8cac8dd1002092110q45411eb1j63bc1b3ce40f3d2e@mail.gmail.com>
	<4B72E23F.9040005@magwerks.com>

On Wed, Feb 10, 2010 at 9:43 AM, Justin Graf <justin@magwerks.com> wrote:
> Keep in mind each connection/client that connecting to the server
> creates a new process on the server.  Each one the settings you list
> above is the max amount of memory each one of those sessions is allowed
> to consume.

It's even worse for work_mem (formerly sort_mem) in that each
individual hash agg or sort can grab that much memory.  A complex
query with 4 sorts and 2 hash aggregates could chew through 6 x
work_mem if it needed it.  Which is why work_mem can be such a
horrific foot gun.



view thread (3+ messages)

Message-ID: <dcc563d11002101946o36d022e6me20c65cfff81b894@mail.gmail.com>
Permalink:  ../dcc563d11002101946o36d022e6me20c65cfff81b894@mail.gmail.com/
Also on:    postgresql.org/message-id/dcc563d11002101946o36d022e6me20c65cfff81b894@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: scott.marlowe@gmail.com, justin@magwerks.com, anton200@gmail.com
  Subject: Re: How exactly PostgreSQL allocates memory for its needs?
  In-Reply-To: <dcc563d11002101946o36d022e6me20c65cfff81b894@mail.gmail.com>
  References: <8cac8dd1002092110q45411eb1j63bc1b3ce40f3d2e@mail.gmail.com> <4B72E23F.9040005@magwerks.com> <dcc563d11002101946o36d022e6me20c65cfff81b894@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox