Re: Making Vars outer-join aware - Mailing list pgsql-hackers

From Richard Guo
Subject Re: Making Vars outer-join aware
Date
Msg-id CAMbWs498WbksxYZLf6j7FxmsBA2-2eFXnEk+Y7JC735GraHR+g@mail.gmail.com
Whole thread Raw
In response to Re: Making Vars outer-join aware  (Richard Guo <guofenglinux@gmail.com>)
Responses Re: Making Vars outer-join aware
List pgsql-hackers

On Thu, Aug 25, 2022 at 6:27 PM Richard Guo <guofenglinux@gmail.com> wrote:
I'm not sure if I understand it correctly. If we are given the first
order from the parser, the SpecialJoinInfo for the B/C join would have
min_lefthand as containing both B and the A/B join. And this
SpecialJoinInfo would make the B/C join be invalid, which is not what we
want. 
 
Now I see how this works from v6 patch.  Once we notice identity 3
applies, we will remove the lower OJ's ojrelid from the min_lefthand or
min_righthand so that the commutation is allowed.  So in this case, the
A/B join would be removed from B/C join's min_lefthand when we build the
SpecialJoinInfo for B/C join, and that makes the B/C join to be legal.

BTW, inner_join_rels can contain base Relids and OJ Relids.  Maybe we
can revise the comments a bit for it atop deconstruct_recurse and
make_outerjoininfo.  The same for the comments of qualscope, ojscope and
outerjoin_nonnullable atop distribute_qual_to_rels.

The README mentions restriction_is_computable_at(), I think it should be
clause_is_computable_at().

Thanks
Richard

pgsql-hackers by date:

Previous
From: Juan José Santamaría Flecha
Date:
Subject: Re: WIN32 pg_import_system_collations
Next
From: Bharath Rupireddy
Date:
Subject: Re: Printing backtrace of postgres processes