De-dupicate Memoize cache keys
David Rowley <drowley@postgresql.org>
De-dupicate Memoize cache keys It was possible when determining the cache keys for a Memoize path that if the same expr appeared twice in the parameterized path's ppi_clauses and/or in the Nested Loop's inner relation's lateral_vars. If this happened the Memoize node's cache keys would contain duplicates. This isn't a problem for correctness, all it means is that the cache lookups will be suboptimal due to having redundant work to do on every hash table lookup and insert. Here we adjust paraminfo_get_equal_hashops() to look for duplicates and ignore them when we find them. Author: David Rowley Reviewed-by: Richard Guo Discussion: https://postgr.es/m/422277.1706207562%40sss.pgh.pa.us
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/path/joinpath.c | modified | +20 −4 |
| src/test/regress/expected/memoize.out | modified | +1 −1 |
Discussion
- A performance issue with Memoize 25 messages · 2023-10-20 → 2024-02-01