Re: where does postgres keep the query result until it is returned? - Mailing list pgsql-general

From Sam Mason
Subject Re: where does postgres keep the query result until it is returned?
Date
Msg-id 20100917131457.GB31536@samason.me.uk
Whole thread Raw
In response to where does postgres keep the query result until it is returned?  (Willy-Bas Loos <willybas@gmail.com>)
Responses Re: where does postgres keep the query result until it is returned?  (Sam Mason <sam@samason.me.uk>)
List pgsql-general
On Fri, Sep 17, 2010 at 03:00:36PM +0200, Willy-Bas Loos wrote:
> Where does postgres keep the query result until it is returned?
> In the shared_buffers?
> Or in extra memory that was not previously allocated, or something else?

Postgres, the server software, will spill large results (and any
intermediate working sets) to disk automatically as needed.  I believe
any memory allocated for this task will be up to work_mem in size.

The client side however isn't as intelligent, libpq will, by default,
try and read all records into memory and will crash if the results are
too large.  There are various ways of dealing with this, but haven't
tried myself.

--
  Sam  http://samason.me.uk/

pgsql-general by date:

Previous
From: Willy-Bas Loos
Date:
Subject: where does postgres keep the query result until it is returned?
Next
From: Sam Mason
Date:
Subject: Re: where does postgres keep the query result until it is returned?