Re: plpgsql arrays

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Matthew Wakeling <matthew(at)flymine(dot)org>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: plpgsql arrays
Date: 2009-04-03 14:08:35
Message-ID: 28757.1238767715@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Matthew Wakeling <matthew(at)flymine(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Matthew Wakeling 2009-04-03 14:14:54 Re: plpgsql arrays
Previous Message Tom Lane 2009-04-03 14:04:02 Re: plpgsql arrays