pgsql: Show Material node Maximum Storage for parallel workers

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Show Material node Maximum Storage for parallel workers
Date: 2026-10-12 09:42:53
Message-ID: E1xGCYX-00000001ItI-228e@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Show Material node Maximum Storage for parallel workers

1eff8279d did this for the leader, but neglected to consider that the
Material node may be below a Gather or Gather Merge and have parallel
workers also participate in the execution of the Material node.

Here we add EXPLAIN ANALYZE output to show Maximum Storage per worker
and all the required shared memory related code to get those details
back to the leader from each worker.

Because the prior code didn't have parallel worker processes report the
tuplestore usage details, this meant that the EXPLAIN ANALYZE output
didn't show the Maximum Storage when running debug_parallel_query =
regress. You could argue that fixing that should be a bug fix, but
fixing it would start reporting the Maximum Storage for Material nodes
for parallel workers during parallel queries, which feels more like a
new feature than a bug fix. The telemetery data going missing with
debug_parallel_query = regress isn't the end of the world, so let's just
fix this in master.

Author: David Rowley <dgrowleyml(at)gmail(dot)com>
Reviewed-by: Tatsuya Kawata <kawatatatsuya0913(at)gmail(dot)com>
Reviewed-by: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAApHDvoUWCms-b27MpDKd5_RUFtAnVrxPgN9u3QoQbBihk+S6g@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/commands/explain.c | 36 +++++++++--
src/backend/executor/execParallel.c | 17 +++++
src/backend/executor/nodeMaterial.c | 110 +++++++++++++++++++++++++++++++++
src/include/executor/instrument_node.h | 21 +++++++
src/include/executor/nodeMaterial.h | 7 +++
src/include/nodes/execnodes.h | 1 +
src/tools/pgindent/typedefs.list | 2 +
7 files changed, 189 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-10-12 10:06:04 pgsql: doc: Consistently use double quotes for attrs in ulinks
Previous Message Matthias van de Meent 2026-10-12 08:57:32 Re: pgsql: Add nbtree README note on index-only scans in recovery.