pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: A.M. <agentm@themactionfaction.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Limit vs setMaxRows issue
Date: Wed, 21 Jun 2006 12:46:34 -0400
Message-ID: <11362.1150908394@sss.pgh.pa.us> (raw)
In-Reply-To: <34158.216.41.12.254.1150906222.squirrel@webmail.webopticon.org>
References: <44990D57.9070506@sebster.com>
	<Pine.BSO.4.63.0606211055020.7242@leary2.csoft.net>
	<34158.216.41.12.254.1150906222.squirrel@webmail.webopticon.org>

"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



view thread (23+ messages)  latest in thread

Message-ID: <11362.1150908394@sss.pgh.pa.us>
Permalink:  ../11362.1150908394@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11362.1150908394@sss.pgh.pa.us

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, agentm@themactionfaction.com
  Subject: Re: Limit vs setMaxRows issue
  In-Reply-To: <11362.1150908394@sss.pgh.pa.us>
  References: <44990D57.9070506@sebster.com> <Pine.BSO.4.63.0606211055020.7242@leary2.csoft.net> <34158.216.41.12.254.1150906222.squirrel@webmail.webopticon.org> <11362.1150908394@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