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

From Richard Guo
Subject Re: Making Vars outer-join aware
Date
Msg-id CAMbWs498oYx4pjzOsjxu0wG0D73e2+OFAqkbPotcSJDKzm-s4Q@mail.gmail.com
Whole thread Raw
In response to Re: Making Vars outer-join aware  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Making Vars outer-join aware
Re: Making Vars outer-join aware
List pgsql-hackers

On Wed, Aug 17, 2022 at 4:57 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
On further thought, it seems better to maintain the index array
from the start, allowing complete replacement of the linear list
searches.  We can add a separate bool flag to denote frozen-ness.

+1 for 0001 patch. Now we process plain Vars and PlaceHolderVars in a
more consistent way when building joinrel's tlist. And this change would
make it easier to build up phnullingrels for PHVs as we climb up the
join tree.

BTW, the comment just above the two calls to build_joinrel_tlist says:

 * Create a new tlist containing just the vars that need to be output from

Here by 'vars' it means both plain Vars and PlaceHolderVars, right? If
not we may need to adjust this comment to also include PlaceHolderVars.


0002 patch looks good to me. Glad we can get rid of create_new_ph flag.
A minor comment is that seems we can get rid of phid inside
PlaceHolderInfo, since we do not do linear list searches any more. It's
some duplicate to the phid inside PlaceHolderVar. Currently there are
two places referencing PlaceHolderInfo->phid, remove_rel_from_query and
find_placeholder_info. We can use PlaceHolderVar->phid instead in both
the two places.

Thanks
Richard

pgsql-hackers by date:

Previous
From: Quan Zongliang
Date:
Subject: Re: Bug: When user-defined AM is used, the index path cannot be selected correctly
Next
From: Aleksander Alekseev
Date:
Subject: Proposal: CREATE/ALTER DOMAIN ... STORAGE/COMPRESSION = ...