Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 1F41064FD44 for ; Thu, 1 Jan 2009 15:29:48 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 87824-06 for ; Thu, 1 Jan 2009 15:29:45 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.184]) by mail.postgresql.org (Postfix) with ESMTP id 27BD064FD24 for ; Thu, 1 Jan 2009 15:29:44 -0400 (AST) Received: by fk-out-0910.google.com with SMTP id e30so3458698fke.3 for ; Thu, 01 Jan 2009 11:29:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=/NE6psA+2ep5y8V8S043m5WmoCvEld0Kw46EsHFF43c=; b=s1znv6s1AZIh9nWA1zrc9BJQbkCMPx8ISpA031XG0Ir3qahi48rqFn/ww4b1qYMZi/ 2i4834yr1gDd7tOfcDuH9lhMbwYDn2KBQQSCMQWrgaSCxffbnvVx8lhc8zS5SuRyVTvt HBTK+yuBPdlgxNeEvFlgJhqoVNfS43yPedS9o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=HHlxI0+d7COD4dbUjAigOIMNmSN1LEaBioBayLECi2dthH/bhiHU58pWF5fsXG7TCE p8Ui7cLDJbs76XPVlZ4FZzqIe41vfPTdVmsra8t+pzXHl536mTkX01M0appmE441W2ZM ziXBJ7TonCdPCyW5XqtwQ0y88+J4HSvPvjESw= Received: by 10.86.79.19 with SMTP id c19mr10042942fgb.26.1230838183897; Thu, 01 Jan 2009 11:29:43 -0800 (PST) Received: by 10.86.78.15 with HTTP; Thu, 1 Jan 2009 11:29:43 -0800 (PST) Message-ID: <1d4e0c10901011129w443a096apac00c9d106669604@mail.gmail.com> Date: Thu, 1 Jan 2009 20:29:43 +0100 From: "Guillaume Smet" To: david@lang.hm Subject: Re: Poor plan choice in prepared statement Cc: "Alvaro Herrera" , "Tom Lane" , "Scott Carey" , bricklen , "Scott Marlowe" , "Merlin Moncure" , "pgsql-performance@postgresql.org" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <33b743250812301059u31ce82faw3d72a38280b37402@mail.gmail.com> <2796.1230678149@sss.pgh.pa.us> <20081231160118.GE3809@alvh.no-ip.org> <1d4e0c10901011022v4a1d5eeaidc2692a7729e79df@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200901/4 X-Sequence-Number: 32283 On Thu, Jan 1, 2009 at 9:24 PM, wrote: > forgive my ignorance here, but if it's unnamed how can you reference it > later to take advantage of the parsing? You can't. That's what unnamed prepared statements are for. It's not obvious to me that the parsing phase is worth any "caching". From my experience, the planning phase takes far much time on complex queries. -- Guillaume