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

From: Scott Ribe <scott_ribe(at)killerbytes(dot)com>
To: Willy-Bas Loos <willybas(at)gmail(dot)com>
Cc: pgsql-general Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: where does postgres keep the query result until it is returned?
Date: 2010-09-20 14:56:59
Message-ID: 409DB836-C1B1-429C-8F24-A9E726F25922@killerbytes.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sep 20, 2010, at 8:06 AM, Willy-Bas Loos wrote:

> Sheesh..
>
> - why?

Because you start with 4GB of address space, immediately give up maybe 0.5GB for mapping executable code (all the system libraries that get linked), plus a good chunk for the main thread stack, plus library data structures. End result is you likely have about 2GB (or less) address space available for heap allocations. And this of course will get used and at least somewhat fragmented as your program runs. So it is difficult to find a 1GB contiguous block for allocation.

> - how about 64 bit?

Well, you start with 17,179,869,184GB of address space, so of course it's different. It tends to be pretty easy to find a contiguous 1GB block in an address space that size.

> - should this be documented?

Doubtful. It has to do with very well known limits of 32-bit programs, applies to any use for a 1GB block regardless of where it comes from (network or disk), really has nothing to do with postgres, and the actual size at which you'll start to have problems with vary a good bit depending on: OS, libraries you link to, memory management library you use, memory management techniques you use, and to a very great extent your specific app and exactly what it does.

--
Scott Ribe
scott_ribe(at)elevated-dev(dot)com
http://www.elevated-dev.com/
(303) 722-0567 voice

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John Cheng 2010-09-20 15:21:54 Binary Replication and Slony
Previous Message Colin 't Hart 2010-09-20 14:50:02 Re: to_date conversion semantics?