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

From Marc Herbert
Subject Re: Limit vs setMaxRows issue
Date
Msg-id khjd5cd4zcm.fsf@meije.emic.fr
Whole thread Raw
In response to Limit vs setMaxRows issue  (Sebastiaan van Erk <sebster@sebster.com>)
Responses Re: Limit vs setMaxRows issue
List pgsql-jdbc
Tom Lane <tgl@sss.pgh.pa.us> writes:

> 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.


If planning is done at time of creation of the PreparedStatement
object (reminder: the example given above has no parameters), then the
setMaxRows() call will come too late whatever is the protocol change.
I mean: no protocol change can go back in time and "optimize" by not
doing useless work already done.

Thanks in advance for pointing out my mistake(s) here.

pgsql-jdbc by date:

Previous
From: "Giovanni M."
Date:
Subject: Re: Dúvida
Next
From: Marc Herbert
Date:
Subject: Re: Limit vs setMaxRows issue