Re: parametrized statements, but always replan?

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

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?

BTW, is the default value of prepareThreshold is 1?

Thanks,
Kevin Murphy

* From my post a couple of minutes ago:
> OK, PG definitely plans based on the parameter value. I turned on
> plan logging in the server log, and without specifying
> prepareThreshold at all (e.g. setting it to 0), I can see that PG is
> making different plan [cost] estimates for different parameter values.

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Mark Lewis 2006-12-20 21:36:27 Re: parametrized statements, but always replan?
Previous Message Kevin Murphy 2006-12-20 21:22:00 Re: parametrized statements, but always replan?