Re: Unnecessary lateral dependencies implied by PHVs

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Unnecessary lateral dependencies implied by PHVs
Date: 2022-10-17 02:47:43
Message-ID: CAMbWs49n7LNumoAJs9wfOaspHV4S5hV6h1YhhmpAfEJVzh_upw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 10, 2022 at 10:35 AM Richard Guo <guofenglinux(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message osumi.takamichi@fujitsu.com 2022-10-17 03:02:05 RE: [Proposal] Add foreign-server health checks infrastructure
Previous Message Michael Paquier 2022-10-17 02:44:40 Re: thinko in basic_archive.c