pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Matthew Wakeling <matthew@flymine.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: plpgsql arrays
Date: Fri, 03 Apr 2009 10:24:41 -0400
Message-ID: <29730.1238768681@sss.pgh.pa.us> (raw)
In-Reply-To: <alpine.DEB.2.00.0904031507000.21772@aragorn.flymine.org>
References: <alpine.DEB.2.00.0904031420470.21772@aragorn.flymine.org>
	<603c8f070904030647u1c92e13ew53612ac0011ed7c1@mail.gmail.com>
	<alpine.DEB.2.00.0904031455210.21772@aragorn.flymine.org>
	<28595.1238767442@sss.pgh.pa.us>
	<alpine.DEB.2.00.0904031507000.21772@aragorn.flymine.org>

Matthew Wakeling <matthew@flymine.org> writes:
> On Fri, 3 Apr 2009, Tom Lane wrote:
>> I don't actually believe that a standard merge join algorithm will work
>> with an intransitive join condition ...

> A standard merge join should work absolutely fine, depending on how it's 
> implemented. If the implementation keeps a list of "current" right-hand 
> elements, and adds right-hand rows to the list when they compare "equal" 
> to the current left-hand element, and removes them from the list when they 
> compare "not equal" to the current left-hand element, then it would work 
> fine.

No, it would not.  Not unless you have sorted the inputs in some way
that has more knowledge than the "equal" operator represents.  Otherwise
you can have elements drop out that might still be needed to match to a
later left-hand element.  Remember the point of the intransitivity
assumption: there can be a right-hand element X that is "equal" to two
left-hand elements Y and Z, but Y and Z are not "equal" to each other
and thus might not be kept adjacent in the left-hand sorting.

			regards, tom lane



view thread (32+ messages)  latest in thread

Message-ID: <29730.1238768681@sss.pgh.pa.us>
Permalink:  ../29730.1238768681@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29730.1238768681@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, matthew@flymine.org
  Subject: Re: plpgsql arrays
  In-Reply-To: <29730.1238768681@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox