Re: parametrized statements, but always replan? - Mailing list pgsql-jdbc

From Kevin Murphy
Subject Re: parametrized statements, but always replan?
Date
Msg-id 4589AB12.9080703@genome.chop.edu
Whole thread Raw
In response to Re: parametrized statements, but always replan?  (Mark Lewis <mark.lewis@mir3.com>)
Responses Re: parametrized statements, but always replan?  (Mark Lewis <mark.lewis@mir3.com>)
List 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.


pgsql-jdbc by date:

Previous
From: Kevin Murphy
Date:
Subject: Re: parametrized statements, but always replan?
Next
From: Mark Lewis
Date:
Subject: Re: parametrized statements, but always replan?