Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] implementing outer joins

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: brett(at)work(dot)chicken(dot)org (Brett McCormick)
Cc: pgsql-hackers(at)hub(dot)org
Subject: Re: [HACKERS] implementing outer joins
Date: 1998-07-03 04:08:14
Message-ID: 199807030408.AAA17893@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
> 
> does anyone have any idea how difficult it would be to implement, and
> perhaps point me in the right direction?
> 
> 

Good question.  My guess is that you have to set a flag in the
RangeTblEntry for OUTER, and have this flag read by all the join
methods.  Most(all?) of them have an inner and outer loop.  I think
OUTER has to be in the outer part of the loop, and as you are spinning
through the outer loop, if you don't find any matches in the inner loop,
you output the outer loop with NULLs for the inner values.  Now if you
have only two tables joined, and they are both outer, I am not sure how
to handle that.

Check out the new backend "How PostgreSQL Processes a Query" for hints
on where to make changes.  (I have gotten no comments on the new
version.)  Also check out the Developers FAQ for ideas too.


-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 1998-07-03 04:30:25
Subject: Re: (postgres) Libpq Win32
Previous:From: Brett McCormickDate: 1998-07-03 03:23:58
Subject: you are lost in a maze of twisting code, all alike

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group