pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Emit null-keyed hash join outer tuples immediately when feasible 2+ messages / 1 participants [nested] [flat]
* pgsql: Emit null-keyed hash join outer tuples immediately when feasible @ 2026-10-23 15:35 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2026-10-23 15:35 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Emit null-keyed hash join outer tuples immediately when feasible. Commit 1811f1af9 put outer tuples with null join keys into a tuplestore and emitted them at the end of the batch, which risks expensive spills to disk if there are a lot of them. It's difficult to avoid the tuplestore in a multi-batch parallel join. But in the non-parallel and single-batch cases we can just emit such tuples immediately, at the tiny cost of propagating the "is-null" result flag one call level further up. This avoids a performance regression from v18 for such cases. Author: shihao zhong <zhong950419@gmail.com> Co-authored-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAGRkXqTgugmYrtnP_11NjL_GCXwAfzVfm5WKUNFsfZOzxDF2rA@mail.gmail.com Backpatch-through: 19 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/126976a8ffcfa47f40d3df09243ebf4606001912 Modified Files -------------- src/backend/executor/nodeHashjoin.c | 62 +++++++++++++++++++++++-------------- src/include/executor/hashjoin.h | 11 ++++--- src/include/nodes/execnodes.h | 3 +- 3 files changed, 47 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Emit null-keyed hash join outer tuples immediately when feasible @ 2026-10-23 15:35 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2026-10-23 15:35 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Emit null-keyed hash join outer tuples immediately when feasible. Commit 1811f1af9 put outer tuples with null join keys into a tuplestore and emitted them at the end of the batch, which risks expensive spills to disk if there are a lot of them. It's difficult to avoid the tuplestore in a multi-batch parallel join. But in the non-parallel and single-batch cases we can just emit such tuples immediately, at the tiny cost of propagating the "is-null" result flag one call level further up. This avoids a performance regression from v18 for such cases. Author: shihao zhong <zhong950419@gmail.com> Co-authored-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAGRkXqTgugmYrtnP_11NjL_GCXwAfzVfm5WKUNFsfZOzxDF2rA@mail.gmail.com Backpatch-through: 19 Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/fc189eb75089506fbb4ef7c3765d28f49ce3cf95 Modified Files -------------- src/backend/executor/nodeHashjoin.c | 62 +++++++++++++++++++++++-------------- src/include/executor/hashjoin.h | 11 ++++--- src/include/nodes/execnodes.h | 3 +- 3 files changed, 47 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2026-10-23 15:35 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-10-23 15:35 pgsql: Emit null-keyed hash join outer tuples immediately when feasible Tom Lane <tgl@sss.pgh.pa.us> 2026-10-23 15:35 pgsql: Emit null-keyed hash join outer tuples immediately when feasible Tom Lane <tgl@sss.pgh.pa.us>
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