Richard Guo <guofenglinux@gmail.com> writes:
> I keep thinking about my proposal in v2 patch. It seems more natural to
> me to fix this issue, because an outer join's quals are always treated
> as a whole when we check if identity 3 applies in make_outerjoininfo, as
> well as when we adjust the outer join's quals for commutation in
> deconstruct_distribute_oj_quals.
No, I doubt that that patch works properly. If the join condition
contains independent quals on different relations, say
select ... from t1 left join t2 on (t1.a = 1 and t2.b = 2)
then it may be that those quals need to be pushed to different levels.
I don't believe that considering the union of the rels mentioned in
any qual is a reasonable thing to do here.
regards, tom lane