Re: Check lateral references within PHVs for memoize cache keys

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Check lateral references within PHVs for memoize cache keys
Date: 2023-07-08 17:28:43
Message-ID: 1724688.1688837323@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Richard Guo <guofenglinux(at)gmail(dot)com> writes:
> Rebase the patch on HEAD as cfbot reminds.

This fix seems like a mess. The function that is in charge of filling
RelOptInfo.lateral_vars is extract_lateral_references; or at least
that was how it was done up to now. Can't we compute these additional
references there? If not, maybe we ought to just merge
extract_lateral_references into create_lateral_join_info, rather than
having the responsibility split. I also wonder whether this change
isn't creating hidden dependencies on RTE order (which would likely be
bugs), since create_lateral_join_info itself examines the lateral_vars
lists as it walks the rtable.

More generally, it's not clear to me why we should need to look inside
lateral PHVs in the first place. Wouldn't the lateral PHV itself
serve fine as a cache key?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-07-08 17:50:17 Re: Infinite Interval
Previous Message Joseph Koshakow 2023-07-08 17:18:32 Re: DecodeInterval fixes