From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephen Crowley <stephen.crowley@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Large # of rows in query extremely slow, not using index
Date: Mon, 13 Sep 2004 21:49:14 -0400
Message-ID: <28432.1095126554@sss.pgh.pa.us> (raw)
In-Reply-To: <3f71fdf104091318228099815@mail.gmail.com>
References: <3f71fdf104091317515c756512@mail.gmail.com>
<28088.1095124267@sss.pgh.pa.us>
<3f71fdf104091318228099815@mail.gmail.com>
Stephen Crowley <stephen.crowley@gmail.com> writes:
> On Mon, 13 Sep 2004 21:11:07 -0400, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Stephen Crowley <stephen.crowley@gmail.com> writes:
>>> Does postgres cache the entire result set before it begins returning
>>> data to the client?
>>
>> The backend doesn't, but libpq does, and I think JDBC does too.
> That is incredible. Why would libpq do such a thing?
Because the API it presents doesn't allow for the possibility of query
failure after having given you back a PGresult: either you have the
whole result available with no further worries, or you don't.
If you think it's "incredible", let's see you design an equally
easy-to-use API that doesn't make this assumption.
(Now having said that, I would have no objection to someone extending
libpq to offer an alternative streaming API for query results. It
hasn't got to the top of anyone's to-do list though ... and I'm
unconvinced that psql could use it if it did exist.)
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, stephen.crowley@gmail.com
Subject: Re: Large # of rows in query extremely slow, not using index
In-Reply-To: <28432.1095126554@sss.pgh.pa.us>
* 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