Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 3B83B9FB33B for ; Sat, 23 Jun 2007 19:02:44 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 45160-06 for ; Sat, 23 Jun 2007 19:02:41 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from oxford.xeocode.com (unknown [87.127.95.194]) by postgresql.org (Postfix) with ESMTP id DD1789FB31B for ; Sat, 23 Jun 2007 19:02:40 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=oxford.xeocode.com) by oxford.xeocode.com with esmtp (Exim 4.67) (envelope-from ) id 1I2DgY-0003T9-4V; Sat, 23 Jun 2007 23:02:26 +0100 From: Gregory Stark To: "PFC" Cc: Subject: Re: PREPARE and stuff In-Reply-To: (lists@peufeu.com's message of "Sat, 23 Jun 2007 23:30:06 +0200") Organization: EnterpriseDB References: X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX.performance" 1296) Date: Sat, 23 Jun 2007 23:02:25 +0100 Message-ID: <87myyq9vny.fsf@oxford.xeocode.com> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/560 X-Sequence-Number: 25593 "PFC" writes: > Suppose a web application with persistent database connections. > I have some queries which take longer to plan than to execute ! There have periodically been discussions about a shared plan cache but generally the feeling is that it would do more harm than good and there are no plans to implement anything like that. For a web application though you would expect to be executing the same queries over and over again since you would be executing the same pages over and over again. So just a regular prepared query ought to good for your needs. You do not want to be reconnecting to the database for each page fetch. Replanning queries is the least of the problems with that approach. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com