Re: Limit vs setMaxRows issue

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Marc Herbert <Marc(dot)Herbert(at)continuent(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Limit vs setMaxRows issue
Date: 2006-07-11 10:45:56
Message-ID: 44B38164.1040606@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Marc Herbert wrote:
> Oliver Jowett <oliver(at)opencloud(dot)com> writes:

>> the query is parsed and planned immediately before execution.
>
> Hum, interesting. Looks like "lazy prepared" statement, no
> pre-compilation? If you delay parsing & planning then of course you
> would not need to go back in time to add late
> optimizations...

I don't know what you mean by "lazy prepared" statements. We give the
statement to the server for parsing and planning at the point when we
know both the query and the parameter types -- which, because of the
JDBC API design, means just before execution. We retain the parse/plan
results on the server side when it looks like the statement will be
reused (using a simple "how many times has this statement already been
reused?" metric), otherwise we reparse/replan on each execution.

> However, what about the following executions of the same and now
> already prepared and planned statement? Now you would have to go back
> in time to perform any .setMaxRows() optimization, right?

It's no different to the case where you change the parameter types really.

-O

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Marc Herbert 2006-07-11 12:14:58 Re: Limit vs setMaxRows issue
Previous Message Marc Herbert 2006-07-11 10:00:56 Re: Limit vs setMaxRows issue