Re: Disk buffering of resultsets

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: John R Pierce <pierce(at)hogranch(dot)com>, List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Disk buffering of resultsets
Date: 2014-10-04 14:42:13
Message-ID: 54300745.5080206@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 09/23/2014 05:17 AM, John R Pierce wrote:
>>
>
> this still won't address the issue that the postgresql server itself
> ALSO marshals the entire result set into ITS memory before sending it to
> the client. Really, using cursors for large result-sets is the correct
> way to go.

Er, it what?

It does no such thing.

For some queries it must prepare the entire result before it can send it
- e.g. if there's a top-level sort node that can't be satisfied by an
index-scan of the table in the desired sort order. It'll marshal such
results to disk if they don't fit within working memory, though. (Look
into the tuplestore code for details).

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Craig Ringer 2014-10-04 14:44:36 Re: Disk buffering of resultsets
Previous Message Dave Cramer 2014-09-30 17:53:31 Re: Why is version 9.3-1102 missing Connection.getSchema() support?