Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 867D59FB939 for ; Fri, 12 Oct 2007 05:26:08 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 28899-01 for ; Fri, 12 Oct 2007 05:25:52 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from pih-relay05.plus.net (pih-relay05.plus.net [212.159.14.132]) by postgresql.org (Postfix) with ESMTP id E3C5E9FB8DC for ; Fri, 12 Oct 2007 05:26:04 -0300 (ADT) Received: from [84.51.143.99] (helo=server3.office.archonet.com) by pih-relay05.plus.net with esmtp (Exim) id 1IgFqM-0004HZ-Cp; Fri, 12 Oct 2007 09:26:02 +0100 Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id C584427406B; Fri, 12 Oct 2007 09:26:01 +0100 (BST) Message-ID: <470F2F99.7080706@archonet.com> Date: Fri, 12 Oct 2007 09:26:01 +0100 From: Richard Huxton User-Agent: Thunderbird 2.0.0.6 (X11/20070728) MIME-Version: 1.0 To: theo@flame.co.za CC: pgsql-performance@postgresql.org Subject: Re: Performance problems with prepared statements References: <1192027540.2495.3.camel@localhost.localdomain> <470CE918.4060608@dalibo.com> <1192044840.2549.21.camel@fedmac> <1192176335.2470.20.camel@localhost.localdomain> In-Reply-To: <1192176335.2470.20.camel@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/145 X-Sequence-Number: 27167 Theo Kramer wrote: > On Thu, 2007-10-11 at 18:28 +0000, Andrew - Supernews wrote: >> When you do this from the application, are you passing it 3 parameters, >> or 5? The plan is clearly taking advantage of the fact that the two >> occurrences of $1 and $2 are known to be the same value; if your app is >> using some interface that uses ? placeholders rather than numbered >> parameters, then the planner will not be able to make this assumption. > > You may just have hit the nail on the head. I use numbered parameters > but have $1 to $5 ... let me take a look to see if I can change this. That'll be it. -- Richard Huxton Archonet Ltd