Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 61E1C9FA280 for ; Thu, 21 Dec 2006 01:44:11 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 40185-07-4 for ; Thu, 21 Dec 2006 01:43:54 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 851119FB278 for ; Thu, 21 Dec 2006 01:42:27 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id kBL5gMqm014092; Thu, 21 Dec 2006 00:42:22 -0500 (EST) To: Dave Cramer cc: Kevin Murphy , pgsql-jdbc@postgresql.org Subject: Re: parametrized statements, but always replan? In-reply-to: <81F542C8-256C-4C29-AC7D-9223BBB3B2E0@fastcrypt.com> References: <45899296.9040008@genome.chop.edu> <81F542C8-256C-4C29-AC7D-9223BBB3B2E0@fastcrypt.com> Comments: In-reply-to Dave Cramer message dated "Wed, 20 Dec 2006 15:07:22 -0500" Date: Thu, 21 Dec 2006 00:42:22 -0500 Message-ID: <14091.1166679742@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/108 X-Sequence-Number: 16340 Dave Cramer writes: > The only time prepared statements won't replan is if you re-use the > prepared statement, which your code does not. > However... AFAIK, postgresql does not plan based on the parameter. This was changed in 8.2: for an unnamed statement the planning step is delayed until Bind time, so that the actual parameter values can be considered. regards, tom lane