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 B3C65D1B561 for ; Mon, 20 Oct 2003 18:26:55 +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 82216-02 for ; Mon, 20 Oct 2003 15:26:25 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id A9D12D1B538 for ; Mon, 20 Oct 2003 15:26:14 -0300 (ADT) Received: from [66.219.92.2] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3795795; Mon, 20 Oct 2003 11:26:55 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Joe Conway , Richard Huxton Subject: Re: Which is faster SQL or PL/PGSQL Date: Mon, 20 Oct 2003 11:24:02 -0700 User-Agent: KMail/1.4.3 Cc: Michael Pohl , pgsql-sql@postgresql.org, "George A.J" References: <200310201849.19668.dev@archonet.com> <3F942558.2000804@joeconway.com> In-Reply-To: <3F942558.2000804@joeconway.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200310201124.02090.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/250 X-Sequence-Number: 15650 Joe, > Yes, I believe so (well, actually the optimizer). An inlined SQL=20 > function ends up behaving like a macro that expands at run time and is=20 > therefore quite fast -- no function call overhead at all. ... but only in 7.4. In 7.2 and I think in 7.3 this was not implemented. While we're on the topic, anyone know any good ways to speed up EXECUTE=20 statements in PL/pgSQL functions? --=20 -Josh Berkus Aglio Database Solutions San Francisco