Re: parametrized statements, but always replan?

From: Mark Lewis <mark(dot)lewis(at)mir3(dot)com>
To: Kevin Murphy <murphy(at)genome(dot)chop(dot)edu>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: parametrized statements, but always replan?
Date: 2006-12-20 21:36:27
Message-ID: 1166650587.7947.129.camel@archimedes
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Wed, 2006-12-20 at 16:28 -0500, Kevin Murphy wrote:
> Mark Lewis wrote:
> > Set the prepareThreshold to 0, meaning that it will never create a
> > "real" server-side prepared statement.
> Hmm, even by default (without specifying prepareThreshold), it seems
> that the planner looks at the parameter values for the first execution
> of the query. (See my post a couple minutes ago*). Am I mistaken?
>
> If I'm not mistaken, then for one-shot queries, is there any any
> additional advantage to setting prepareThreshold to 0?

With the current driver version, there is no advantage if you only use
the PreparedStatement once.

> BTW, is the default value of prepareThreshold is 1?

The default value in the driver version I've got handy (forget exactly
which version this is) is 5. I don't think that's changed recently.

-- Mark Lewis

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kevin Murphy 2006-12-20 21:58:12 State of the art in large scale inserts
Previous Message Kevin Murphy 2006-12-20 21:28:50 Re: parametrized statements, but always replan?