X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 7CEA8D1B52D for ; Mon, 20 Oct 2003 17:49:53 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 72445-05 for ; Mon, 20 Oct 2003 14:49:22 -0300 (ADT) Received: from anchor-post-34.mail.demon.net (anchor-post-34.mail.demon.net [194.217.242.92]) by svr1.postgresql.org (Postfix) with ESMTP id B614CD1B515 for ; Mon, 20 Oct 2003 14:49:21 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-34.mail.demon.net with esmtp (Exim 3.35 #1) id 1ABe9h-000AET-0Y; Mon, 20 Oct 2003 18:49:21 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 54363182E9; Mon, 20 Oct 2003 18:49:20 +0100 (BST) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id B4E93182E5; Mon, 20 Oct 2003 18:49:19 +0100 (BST) From: Richard Huxton To: Joe Conway Subject: Re: Which is faster SQL or PL/PGSQL Date: Mon, 20 Oct 2003 18:49:19 +0100 User-Agent: KMail/1.5 Cc: Michael Pohl , pgsql-sql@postgresql.org, "George A.J" References: <200310201809.51830.dev@archonet.com> <3F941A43.1040802@joeconway.com> In-Reply-To: <3F941A43.1040802@joeconway.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200310201849.19668.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/246 X-Sequence-Number: 15646 On Monday 20 October 2003 18:24, Joe Conway wrote: > Richard Huxton wrote: > > So - gain by not re-planning on every call, but maybe lose because your > > plan is not so precise. > > > > Of course, any queries you build dynamically and run via EXECUTE will > > have to be planned each time. > > This question gets even more complex in 7.4, where many simple SQL > functions will get inlined, and library preloading is available to speed > that first PL/pgSQL call. What will be the effects of inlining? Does it mean the planner merges the function's plan into the larger query? -- Richard Huxton Archonet Ltd