Re: Check lateral references within PHVs for memoize cache keys
Richard Guo <guofenglinux@gmail.com>
From: Richard Guo <guofenglinux@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>,
David Rowley <dgrowleyml@gmail.com>
Date: 2024-06-18T01:47:27Z
Lists: pgsql-hackers
Attachments
- v7-0001-Check-lateral-refs-within-PHVs-for-memoize-cache-keys.patch (application/octet-stream) patch v7-0001
On Mon, Mar 18, 2024 at 4:36 PM Richard Guo <guofenglinux@gmail.com> wrote: > Here is another rebase over master so it applies again. I also added a > commit message to help review. Nothing else has changed. AFAIU currently we do not add Memoize nodes on top of join relation paths. This is because the ParamPathInfos for join relation paths do not maintain ppi_clauses, as the set of relevant clauses varies depending on how the join is formed. In addition, joinrels do not maintain lateral_vars. So we do not have a way to extract cache keys from joinrels. (Besides, there are places where the code doesn't cope with Memoize path on top of a joinrel path, such as in get_param_path_clause_serials.) Therefore, when extracting lateral references within PlaceHolderVars, there is no need to consider those that are due to be evaluated at joinrels. Hence, here is v7 patch for that. In passing, this patch also includes a comment explaining that Memoize nodes are currently not added on top of join relation paths (maybe we should have a separate patch for this?). Thanks Richard
Commits
-
Check lateral references within PHVs for memoize cache keys
- 069d0ff0226b 18.0 landed
-
Doc: update old reference to "result cache"
- 571377dfb83d 14.9 landed
- 3883ef3236e5 15.4 landed
- 6d8b5f49f0e1 16.0 landed
- c23e7ea4d6a4 17.0 landed