Hi Richard: On Mon, Oct 10, 2022 at 10:35 AM Richard Guo <guofengli...@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. 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