Re: Optimization rules for semi and anti joins

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Optimization rules for semi and anti joins
Date: 2009-02-10 21:51:01
Message-ID: 603c8f070902101351i41077552j780054bf36c50654@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> A6. (A antijoin B on (Pab)) leftjoin C on (Pbc)
> = A antijoin (B leftjoin C on (Pbc)) on (Pab)
>
> The second form is in fact equivalent to null-extending the A/B antijoin
> --- the actual contents of C cannot affect the result. So we could just

I don't understand why antijoins need to null-extend the tuple at all.
It seems that it would be cheaper and all-around simpler to just pass
through the left-hand tuple unchanged.

In the case of a semijoin, it's theoretically possible that there
could be syntax which allows access to the attributes of the outer
side of the relation, though IN and EXISTS do not. But with an
antijoin that's just nonsense, so I don't quite understand why we're
handling it as we are.

...Robert

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-02-10 22:03:32 Re: Optimization rules for semi and anti joins
Previous Message David Rowley 2009-02-10 21:26:35 Bug #4284