Re: where does postgres keep the query result until it is returned?

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: where does postgres keep the query result until it is returned?
Date: 2010-09-17 13:14:57
Message-ID: 20100917131457.GB31536@samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2010-09-17 13:19:51 Re: where does postgres keep the query result until it is returned?
Previous Message Willy-Bas Loos 2010-09-17 13:00:36 where does postgres keep the query result until it is returned?