Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 849D39FB309 for ; Sat, 23 Jun 2007 18:29:48 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 70556-10 for ; Sat, 23 Jun 2007 18:29:45 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from h07.llord.com (unknown [195.140.142.194]) by postgresql.org (Postfix) with ESMTP id 84E559FB308 for ; Sat, 23 Jun 2007 18:29:45 -0300 (ADT) Received: from par69-8-88-161-102-87.fbx.proxad.net ([88.161.102.87] helo=apollo13) by h07.llord.com with esmtpa (Exim 4.66) (envelope-from ) id 1I2DAo-0005jC-LY for pgsql-performance@postgresql.org; Sat, 23 Jun 2007 23:29:38 +0200 Date: Sat, 23 Jun 2007 23:30:06 +0200 To: "pgsql-performance@postgresql.org" Subject: PREPARE and stuff From: PFC Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: User-Agent: Opera Mail/9.21 (Linux) X-PopBeforeSMTPSenders: junk@peufeu.com, lists@peufeu.com, peufeu@peufeu.com, pfcaillaud@peufeu.com X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - h07.llord.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - peufeu.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.511 tagged_above=0 required=5 tests=AWL=-0.265, BAYES_50=0.001, RCVD_IN_NJABL_SPAM=2.775 X-Spam-Level: ** X-Archive-Number: 200706/557 X-Sequence-Number: 25590 Suppose a web application with persistent database connections. I have some queries which take longer to plan than to execute ! I with there was a way to issue a PREPARE (like "PERSISTENT PREPARE"). Now all Postgres connections would know that prepared statement foo( $1, $2, $3 ) corresponds to some SQL query, but it wouldn't plan it yet. Just like a SQL function. When invoking EXECUTE foo( 1,2,3 ) on any given connection the statement would get prepared and planned. Then on subsequent invocations I'd just get the previously prepared plan. Is this planned ?