pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Matthew Wakeling <matthew@flymine.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: plpgsql arrays
Date: Fri, 03 Apr 2009 10:08:35 -0400
Message-ID: <28757.1238767715@sss.pgh.pa.us> (raw)
In-Reply-To: <alpine.DEB.2.00.0904031420470.21772@aragorn.flymine.org>
References: <alpine.DEB.2.00.0904031420470.21772@aragorn.flymine.org>

Matthew Wakeling <matthew@flymine.org> writes:
> I have discovered that creating large arrays in plpgql is rather slow. In 
> fact, it seems to be O(n^2).

For variable-width element types, yeah.  Don't go that way.

> ... alternatively is there a way to read two results streams 
> simultaneously?

Use two cursors and FETCH from each as needed?  In recent releases you
can even scroll backwards, which you're going to need to do to make
a merge join work.

			regards, tom lane



view thread (32+ messages)  latest in thread

Message-ID: <28757.1238767715@sss.pgh.pa.us>
Permalink:  ../28757.1238767715@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28757.1238767715@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, matthew@flymine.org
  Subject: Re: plpgsql arrays
  In-Reply-To: <28757.1238767715@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox