Re: plpgsql arrays - Mailing list pgsql-performance

From Tom Lane
Subject Re: plpgsql arrays
Date
Msg-id 28757.1238767715@sss.pgh.pa.us
Whole thread Raw
In response to plpgsql arrays  (Matthew Wakeling <matthew@flymine.org>)
Responses Re: plpgsql arrays
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: plpgsql arrays
Next
From: Matthew Wakeling
Date:
Subject: Re: plpgsql arrays