pgsql: Eliminate duplicative hashtempcxt in nodeSubplan.c.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Eliminate duplicative hashtempcxt in nodeSubplan.c.
Date: 2025-09-10 20:15:13
Message-ID: E1uwRDl-0004M5-0Q@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)sss(dot)pgh(dot)pa(dot)us>
Reviewed-by: Haiyang Li <mohen(dot)lhy(at)alibaba-inc(dot)com>
Reviewed-by: Fei Changhong <feichanghong(at)qq(dot)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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2025-09-10 21:51:31 pgsql: Avoid faulty alignment of Datums in build_sorted_items().
Previous Message Nathan Bossart 2025-09-10 16:22:33 pgsql: meson: Build numeric.c with -ftree-vectorize.