Re: join from array or cursor

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Sam Mason <sam(at)samason(dot)me(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: join from array or cursor
Date: 2009-08-21 12:16:48
Message-ID: E3FB9BB4-4DDB-4A86-AA18-AD02B855B01A@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Aug 21, 2009, at 7:26 AM, Sam Mason wrote:

> It may help to wrap the generate_series call into a function so you
> don't have to refer to "myPkArray" so many times.

Yes, this is the best I have come up with so far. I have a set
returning function which returns the key and the index number. The
implementation with a cursor looks like this:

SELECT * FROM cursor_pk('c1') c LEFT JOIN foo ON (c.pk = foo.pk) ORDER
BY c.idx;

An array function could return the same values. I need to do some
testing to see what the performance looks likes for each method.
Thanks for the suggestion.

John DeSoi, Ph.D.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Waller 2009-08-21 12:16:50 "Number of columns exceed limit" on a hierarchy of views
Previous Message Daniel Verite 2009-08-21 12:04:29 Re: Generating random unique alphanumeric IDs