Re: Unnecessary lateral dependencies implied by PHVs

From: Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Unnecessary lateral dependencies implied by PHVs
Date: 2022-10-18 01:14:49
Message-ID: CAKU4AWoEqy3kGWWYgNbNDe=9DyuA54Jb=6bSLWk3PuF8rwsWqg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Richard:

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

postgres=# explain (costs off) select * from r1 join lateral (select r1.a
from r2) on true;
QUERY PLAN
----------------------------
Nested Loop
-> Seq Scan on r1
-> Materialize
-> Seq Scan on r2
(4 rows)

Time: 0.349 ms
postgres=# set enable_nestloop to off;
SET
Time: 0.123 ms

postgres=# explain (costs off) select * from r1 join lateral (select r1.a
from r2) on true;
QUERY PLAN
----------------------------
Nested Loop
-> Seq Scan on r1
-> Materialize
-> Seq Scan on r2
(4 rows)

--
Best Regards
Andy Fan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message kuroda.hayato@fujitsu.com 2022-10-18 01:30:57 RE: TRAP: FailedAssertion("prev_first_lsn < cur_txn->first_lsn", File: "reorderbuffer.c", Line: 927, PID: 568639)
Previous Message Zheng Li 2022-10-18 01:08:55 Re: Support logical replication of DDLs