Re: Unnecessary lateral dependencies implied by PHVs - Mailing list pgsql-hackers

From Richard Guo
Subject Re: Unnecessary lateral dependencies implied by PHVs
Date
Msg-id CAMbWs49n7LNumoAJs9wfOaspHV4S5hV6h1YhhmpAfEJVzh_upw@mail.gmail.com
Whole thread Raw
In response to Unnecessary lateral dependencies implied by PHVs  (Richard Guo <guofenglinux@gmail.com>)
List pgsql-hackers

On Mon, Oct 10, 2022 at 10:35 AM Richard Guo <guofenglinux@gmail.com> wrote:
As we know when we pull up a simple subquery, if the subquery is within
the nullable side of an outer join, lateral references to non-nullable
items may have to be turned into PlaceHolderVars. I happened to wonder
what should we do about the PHVs if the outer join is reduced to inner
join afterwards. Should we unwrap the related PHVs? I'm asking because
PHVs may imply lateral dependencies which may make us have to use
nestloop join. 
 
At first I considered about unwrapping the related PHVs after we've
successfully reduced outer joins to inner joins. But that requires a lot
of coding which seems not worth the trouble.

I think maybe the problem here is about the order we pull up subqueries
and we reduce outer joins. But simply flipping the order for them two is
definitely incorrect. I'm not sure how to make it right.

Any thoughts?

Thanks
Richard

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: thinko in basic_archive.c
Next
From: "osumi.takamichi@fujitsu.com"
Date:
Subject: RE: [Proposal] Add foreign-server health checks infrastructure