Brandon Craig Rhodes <brandon@oit.gatech.edu> writes:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>> It seems like a useful optimization, but I have an uncomfortable
>> feeling that there's something wrong with it. Can you point to a
>> rigorous proof that this is okay in complicated contexts such as
>> nested outer joins?
> We can optimize the above query simply by observing that the result of
> a LEFT JOIN includes both the rows that would have been produced by a
> simple JOIN, and those rows of the left table that did not match any
> from the right. [snip]
You didn't answer my question: when there are *nested* outer joins, how
does this transformation apply? Can a clause from WHERE or an
upper-level JOIN/ON clause be pushed down past one outer join and into
another?
regards, tom lane