Re: Bind message

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Markus Schaber <schabi(at)logix-tt(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Bind message
Date: 2006-09-25 21:42:57
Message-ID: 45184D61.3010007@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Markus Schaber wrote:
> Hi, Kris,
>
> Kris Jurka wrote:
>
>>Sometimes it is, sometimes the purpose of using a PreparedStatement is
>>to avoid escaping data yourself for a plain Statement execution. There
>>are potential performance penalties for using a "reusable" server side
>>prepared statement because it plans them with generic parameters, not
>>those supplied in your query. For this reason we want to be sure that
>>people will actually be reusing these statements before switching to
>>this mode. I believe the default prepareThreshold is set to 5 despite
>>what the documentation says.
>
>
> 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.

-O

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2006-09-26 04:43:06 Re: Exception in thread "main" java.lang.OutOfMemoryError:
Previous Message Guy Rouillier 2006-09-25 21:28:55 Re: Bind message