Re: Bind message

From: Kris Jurka <books(at)ejurka(dot)com>
To: Guy Rouillier <guyr(at)masergy(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Bind message
Date: 2006-09-25 19:21:09
Message-ID: Pine.BSO.4.63.0609251417310.4350@leary2.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Mon, 25 Sep 2006, Guy Rouillier wrote:

> Dave Cramer wrote:
>>
>> The default is not to re-use statements, you have add
>> prepareThreshold=n to the url where n is greater than 0. What this
>> means is that after n times of use the prepared statement will be
>> re-used..
>
> That's peculiar. The whole point of prepared statements is to obtain
> the optimization of statement reuse.

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.

Kris Jurka

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Mark Lewis 2006-09-25 19:23:18 Re: Bind message
Previous Message Guy Rouillier 2006-09-25 19:00:54 Re: Bind message