X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 462CD474E42 for ; Thu, 24 Apr 2003 13:28:11 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id CD877476083 for ; Thu, 24 Apr 2003 13:28:08 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 91A41D618; Thu, 24 Apr 2003 10:28:08 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 875255C0A; Thu, 24 Apr 2003 10:28:08 -0700 (PDT) Date: Thu, 24 Apr 2003 10:28:08 -0700 (PDT) From: Stephan Szabo To: Frederic Jolliton Cc: Subject: Re: Important speed difference between a query and a In-Reply-To: <868ytzsv8y.fsf@mau.localdomain> Message-ID: <20030424101802.M2131-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-26.6 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, QUOTE_TWICE_1,REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/201 X-Sequence-Number: 1707 On Thu, 24 Apr 2003, Frederic Jolliton wrote: > > On Thu, 24 Apr 2003, Frederic Jolliton wrote: > > Perhaps plpgsql with EXECUTE would work better for that, although > > it's likely to have some general overhead. > > The server is rather fast, and the query return 10 to 50 rows in most > case. So, this is probably a solution, even if it's not very > clean. (Well, I have to find an example to RETURN the result of > EXECUTE..) Check out http://techdocs.postgresql.org/guides/SetReturningFunctions specifically the GetRows() function for an example of using for in execute with set returning functions.