Re: A fine point about OUTER JOIN semantics - Mailing list pgsql-hackers

From Tom Lane
Subject Re: A fine point about OUTER JOIN semantics
Date
Msg-id 1690.968103340@sss.pgh.pa.us
Whole thread Raw
In response to Re: A fine point about OUTER JOIN semantics  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
List pgsql-hackers
Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
>>>> In some cases, an outer join with WHERE restrictions reduces to
>>>> an inner join (so the qualification clauses can be consolidated).
>> I recall you having muttered something about that before, but I don't
>> see how it works.  Can you give an example of an outer join that
>> reduces to an inner join?

> Hmm. This example is pretty silly, but afaik it reduces to an inner
> join:

>   select i, j from t1 left join t2 using (i) where j is not null;

> (where t1 has column "i" and t2 has columns "i" and "j").

Well, I guess so, but I can't get excited about adding machinery to
detect cases like this ... are there any less-silly examples that make
a more compelling case for expending planner cycles to see if an outer
join can be reduced to an inner join?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: A fine point about OUTER JOIN semantics
Next
From: Chris
Date:
Subject: Re: OO inheritance implementation