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 CAMbWs4_SXi7LAPeRbDRQ2==m8bkAJhVcEF+QqY7FSRyyOGNf-g@mail.gmail.com
Whole thread Raw
In response to Re: Unnecessary lateral dependencies implied by PHVs  (Andy Fan <zhihui.fan1213@gmail.com>)
List pgsql-hackers

On Tue, Oct 18, 2022 at 9:15 AM Andy Fan <zhihui.fan1213@gmail.com> wrote:
On Mon, Oct 10, 2022 at 10:35 AM Richard Guo <guofenglinux@gmail.com> wrote:
... I'm asking because
PHVs may imply lateral dependencies which may make us have to use
nestloop join.

I thought lateral join imply nestloop join,  am I missing something?  Here is my simple
testing. 
 
I think it's true most of the time.  And that's why we should try to
avoid unnecessary lateral dependencies, as discussed in this thread.

ISTM in your example nestloop is chosen because there is no available
mergejoinable/hashjoinable clause. In your query the lateral subquery
would be pulled up into the parent query and there would be no lateral
dependencies afterwards.

Thanks
Richard

pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: fix archive module shutdown callback
Next
From: Etsuro Fujita
Date:
Subject: Re: havingQual vs hasHavingQual buglets