pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Eliminate duplicative hashtempcxt in nodeSubplan.c.
Date: Wed, 10 Sep 2025 20:15:13 +0000
Message-ID: <E1uwRDl-0004M5-0Q@gemulon.postgresql.org> (raw)

Eliminate duplicative hashtempcxt in nodeSubplan.c.

Instead of building a separate memory context that's used just
for running hash functions, make the hash functions run in the
per-tuple context of the node's innerecontext.  This saves a
little space at runtime, and it avoids needing to reset two
contexts instead of one inside buildSubPlanHash's main loop.

This largely reverts commit 133924e13.  That's safe to do now
because bf6c614a2 decoupled the evaluation context used by
TupleHashTableMatch from that used for hash function evaluation,
so that there's no longer a risk of resetting the innerecontext
too soon.

Per discussion of bug #19040, although this is not directly
a fix for that.

Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Haiyang Li <mohen.lhy@alibaba-inc.com>
Reviewed-by: Fei Changhong <feichanghong@qq.com>
Discussion: https://postgr.es/m/19040-c9b6073ef814f48c@postgresql.org

Branch
------
master

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

Modified Files
--------------
src/backend/executor/nodeSubplan.c | 19 +++++--------------
src/include/nodes/execnodes.h      |  1 -
2 files changed, 5 insertions(+), 15 deletions(-)



Message-ID: <E1uwRDl-0004M5-0Q@gemulon.postgresql.org>
Permalink:  ../E1uwRDl-0004M5-0Q@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uwRDl-0004M5-0Q@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: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Eliminate duplicative hashtempcxt in nodeSubplan.c.
  In-Reply-To: <E1uwRDl-0004M5-0Q@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