Re: Limit vs setMaxRows issue - Mailing list pgsql-jdbc

From Tom Lane
Subject Re: Limit vs setMaxRows issue
Date
Msg-id 11362.1150908394@sss.pgh.pa.us
Whole thread Raw
In response to Re: Limit vs setMaxRows issue  ("A.M." <agentm@themactionfaction.com>)
List pgsql-jdbc
"A.M." <agentm@themactionfaction.com> writes:
> On Wed, June 21, 2006 12:00 pm, Kris Jurka wrote:
>> If you're suggesting that we extended the
>> frontend/backend protocol to include this extra information than that's
>> definitely a feature request, not a bug report.

> The backend protocol already supports maximum row limit if you use the
> extended protocol.

No, it would take a protocol change to add such a thing out-of-line
(that is, not as a LIMIT clause in the query text).  The reason is that
the planning is done at PARSE time, or at the latest BIND time.  The
row limit field in the EXECUTE message comes far too late to affect the
query plan.  EXECUTE's row limit was not meant as anything except a way
to fetch a query result in segments, avoiding the grab-it-all-at-once,
run-out-of-memory syndrome.  It is definitely *not* meant to imply that
the client doesn't intend to fetch the whole query result eventually.

I don't have a lot of sympathy for the OP's position that he shouldn't
have to use a LIMIT clause for this ...

            regards, tom lane

pgsql-jdbc by date:

Previous
From: "A.M."
Date:
Subject: Re: Limit vs setMaxRows issue
Next
From: "Michael Guyver"
Date:
Subject: Binary tx format for an array?