Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id E671C632D13 for ; Sat, 24 Apr 2010 11:38:15 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 83008-08 for ; Sat, 24 Apr 2010 14:37:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f216.google.com (mail-bw0-f216.google.com [209.85.218.216]) by mail.postgresql.org (Postfix) with ESMTP id E8E976328E0 for ; Sat, 24 Apr 2010 11:38:04 -0300 (ADT) Received: by bwz8 with SMTP id 8so10069978bwz.3 for ; Sat, 24 Apr 2010 07:38:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=ZM4CgpZ7xmigMrGRYVv5jRS8pQA5hEDwY/R0KOnZCyg=; b=vg2gL8DXcmYnwh1KC4qDEDXF9ZBOUv+OGS8+XNto1q2etnxvAXVY2CYnfMgcMoFXrm soClzJiIbUAxpSV8HSytyE86ubEn6FwKjsHNtf/zhVJ5tYF9NbL/w6v0dSm3i7YT2uCp WC0Kan3+TGuM6QORR1U5vh3zpEUX3QyXiAE5c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=oylnEyQhqPGCL4kTZImxaeCAUpd+3F73vXLBniTfVJ4+tI9T16KIpc0wdfuzZxD1fH +LQDeyns+QTX7ExSz7U0aMpgWr7/o91x7otyWWwp6V2aCRDeQu4smZgSMHxjf2cTr+ca HCygqc4B1NQ0ePpJEDufAQmyJfGSXCZuULg5s= MIME-Version: 1.0 Received: by 10.204.32.77 with SMTP id b13mr938717bkd.113.1272119882854; Sat, 24 Apr 2010 07:38:02 -0700 (PDT) Received: by 10.204.163.14 with HTTP; Sat, 24 Apr 2010 07:38:02 -0700 (PDT) In-Reply-To: References: Date: Sat, 24 Apr 2010 15:38:02 +0100 Message-ID: Subject: Re: Replacing Cursors with Temporary Tables From: =?UTF-8?Q?Grzegorz_Ja=C5=9Bkiewicz?= To: Merlin Moncure Cc: Eliot Gable , pgsql-performance@postgresql.org Content-Type: multipart/alternative; boundary=000325555bbabab18d0484fc7d4a X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.385 tagged_above=-10 required=5 tests=AWL=-1.186, BAYES_50=0.8, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201004/312 X-Sequence-Number: 38562 --000325555bbabab18d0484fc7d4a Content-Type: text/plain; charset=UTF-8 On Sat, Apr 24, 2010 at 2:23 PM, Merlin Moncure wrote: > > Well, you missed the most important part: not using cursors at all. > Instead of declaring a cursor and looping it to build the array, build > it with array(). That's what I've been saying: arrays can completely > displace both temp tables _and_ cursors when passing small sets around > functions. > > with huge emphasis on the word small. -- GJ --000325555bbabab18d0484fc7d4a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Sat, Apr 24, 2010 at 2:23 PM, Merlin = Moncure <mmoncur= e@gmail.com> wrote:

Well, you missed the most important part: not using cursors at all. Instead of declaring a cursor and looping it to build the array, build
it with array(). =C2=A0That's what I've been saying: arrays can com= pletely
displace both temp tables _and_ cursors when passing small sets around
functions.

with h= uge emphasis on the word small.


--
GJ
--000325555bbabab18d0484fc7d4a--