Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-jdbc by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group