pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Murphy <murphy@genome.chop.edu>
To: Mark Lewis <mark.lewis@mir3.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: parametrized statements, but always replan?
Date: Wed, 20 Dec 2006 16:28:50 -0500
Message-ID: <4589AB12.9080703@genome.chop.edu> (raw)
In-Reply-To: <1166647299.7947.124.camel@archimedes>
References: <45899296.9040008@genome.chop.edu>
	<1166647299.7947.124.camel@archimedes>

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.




view thread (7+ messages)  latest in thread

Message-ID: <4589AB12.9080703@genome.chop.edu>
Permalink:  ../4589AB12.9080703@genome.chop.edu/
Also on:    postgresql.org/message-id/4589AB12.9080703@genome.chop.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: murphy@genome.chop.edu, mark.lewis@mir3.com
  Subject: Re: parametrized statements, but always replan?
  In-Reply-To: <4589AB12.9080703@genome.chop.edu>
  References: <45899296.9040008@genome.chop.edu> <1166647299.7947.124.camel@archimedes> <4589AB12.9080703@genome.chop.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox