Re: Bind message

From: Markus Schaber <schabi(at)logix-tt(dot)com>
To:
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Bind message
Date: 2006-09-26 08:49:10
Message-ID: 4518E986.3030801@logix-tt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi, Oliver,

Oliver Jowett wrote:

>> I remember having read something about delaying the actual planning
>> until the first parameterset arrives.

> The server only does this when you use the unnamed statement (i.e.
> before the driver's prepareThreshold is reached), because the resulting
> plan is only really useful for that particular set of parameter values,
> and using a named statement implies that you want to reuse the
> parse/plan results for other parameter values.

Ah. But usually, the other parameter values for the same prepared
statement produce similar query plans, because they're the same use case
on similar data.

So, at least for most of the apps we're running here, the first set of
parameters makes more sense than planning without any parameters.

Maybe this behaviour should be configurable via some session
configuration variable?

And for applications that really have two very different usecases
resulting in identical prepared statements, it's affordable to either
switch the delayed planning of, or to prepare the statement twice, with
different names and different first parameter sets.

Maybe we should crosspost this to pg_hackers?

Markus

--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS

Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Thomas Kellerer 2006-09-26 09:07:52 Small problem with embedded comments in a statement
Previous Message Kris Jurka 2006-09-26 06:53:06 Re: bytea memory improvement