Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 9BF5D9FA182 for ; Wed, 20 Dec 2006 17:36:34 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 67550-06 for ; Wed, 20 Dec 2006 17:36:27 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mir3-fs.mir3.com (mail.mir3.com [65.208.188.100]) by postgresql.org (Postfix) with ESMTP id B13A69FA248 for ; Wed, 20 Dec 2006 17:36:29 -0400 (AST) Received: mir3-fs.mir3.com 172.16.1.11 from 172.16.2.68 172.16.2.68 via HTTP with MS-WebStorage 6.0.6249 Received: from archimedes.mirlogic.com by mir3-fs.mir3.com; 20 Dec 2006 13:36:28 -0800 Subject: Re: parametrized statements, but always replan? From: Mark Lewis To: Kevin Murphy Cc: pgsql-jdbc@postgresql.org In-Reply-To: <4589AB12.9080703@genome.chop.edu> References: <45899296.9040008@genome.chop.edu> <1166647299.7947.124.camel@archimedes> <4589AB12.9080703@genome.chop.edu> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: MIR3, Inc. Date: Wed, 20 Dec 2006 13:36:27 -0800 Message-Id: <1166650587.7947.129.camel@archimedes> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-27.rhel4.6) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/106 X-Sequence-Number: 16338 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