pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: De-dupicate Memoize cache keys
Date: Fri, 26 Jan 2024 07:51:55 +0000
Message-ID: <E1rTH0F-003Anu-Bt@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/bc397e5cdb31c399392d693cbc5909341d21235a

Modified Files
--------------
src/backend/optimizer/path/joinpath.c | 24 ++++++++++++++++++++----
src/test/regress/expected/memoize.out |  2 +-
2 files changed, 21 insertions(+), 5 deletions(-)



Message-ID: <E1rTH0F-003Anu-Bt@gemulon.postgresql.org>
Permalink:  ../E1rTH0F-003Anu-Bt@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rTH0F-003Anu-Bt@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: drowley@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: De-dupicate Memoize cache keys
  In-Reply-To: <E1rTH0F-003Anu-Bt@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox