Re: plpgsql arrays

From: Matthew Wakeling <matthew(at)flymine(dot)org>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: plpgsql arrays
Date: 2009-04-03 13:57:12
Message-ID: alpine.DEB.2.00.0904031455210.21772@aragorn.flymine.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, 3 Apr 2009, Robert Haas wrote:
> On Fri, Apr 3, 2009 at 9:32 AM, Matthew Wakeling <matthew(at)flymine(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2009-04-03 14:04:02 Re: plpgsql arrays
Previous Message Matthew Wakeling 2009-04-03 13:55:15 Re: Rewriting using rules for performance