Re: plpgsql arrays - Mailing list pgsql-performance

From Matthew Wakeling
Subject Re: plpgsql arrays
Date
Msg-id alpine.DEB.2.00.0904031455210.21772@aragorn.flymine.org
Whole thread Raw
In response to Re: plpgsql arrays  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: plpgsql arrays  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
On Fri, 3 Apr 2009, Robert Haas wrote:
> On Fri, Apr 3, 2009 at 9:32 AM, Matthew Wakeling <matthew@flymine.org> wrote:
>> I'm writing a plpgsql function that effectively does a merge join on the
>> results of two queries.

> Why not just use SQL to do the join?

Because the merge condition is:

WHERE l1.start <= l2.end AND l2.start <= l1.end

and merge joins in postgres only currently cope with the case where the
merge condition is an equals relationship.

Oh, hang on, I think I saw something in the docs about what conditions can
be used in a merge...

Matthew

--
 Let's say I go into a field and I hear "baa baa baa". Now, how do I work
 out whether that was "baa" followed by "baa baa", or if it was "baa baa"
 followed by "baa"?
         - Computer Science Lecturer

pgsql-performance by date:

Previous
From: Matthew Wakeling
Date:
Subject: Re: Rewriting using rules for performance
Next
From: Tom Lane
Date:
Subject: Re: plpgsql arrays