From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add memory/disk usage for Function Scan nodes in EXPLAIN
Date: Tue, 10 Nov 2026 04:29:58 +0000
Message-ID: <E1xQdUc-000000008f8-36rI@gemulon.postgresql.org> (raw)
Add memory/disk usage for Function Scan nodes in EXPLAIN
Commit 1eff8279d added the infrastructure to report the maximum tuplestore
memory or disk usage with EXPLAIN ANALYZE. 95d6e9af0 and 40708acd6
extended that to WindowAgg, CTE Scan, Table Function Scan and Recursive
Union nodes.
Here we add the same reporting for the Function Scan node.
Function Scans can have multiple tuplestores: one for each function
being scanned. We report the sum of the space used by all, and report
the maximum of that sum over all rescans, and report that the disk was
used if any tuplestore ever spills.
Author: Tatsuya Kawata <kawatatatsuya0913@gmail.com>
Reviewed-by: Shashishekar Hullahally Anantharamu <shashi.h.ananth@gmail.com>
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/CAHza6qdpZTTjGJdzUmBkWbDPGB=gsz-vZWm5dO-oim_NrjAXCQ@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/edbb1d2dcb18d0706e644d3048a21e4475debd95
Modified Files
--------------
src/backend/commands/explain.c | 72 +++++++++++++
src/backend/executor/execParallel.c | 19 ++++
src/backend/executor/nodeFunctionscan.c | 163 +++++++++++++++++++++++++++---
src/include/executor/instrument_node.h | 21 ++++
src/include/executor/nodeFunctionscan.h | 8 ++
src/include/nodes/execnodes.h | 25 ++++-
src/test/regress/expected/explain.out | 43 +++++++-
src/test/regress/expected/planner_est.out | 3 +
src/test/regress/sql/explain.sql | 8 ++
src/test/regress/sql/planner_est.sql | 3 +
src/tools/pgindent/typedefs.list | 2 +
11 files changed, 345 insertions(+), 22 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: drowley@postgresql.org
Subject: Re: pgsql: Add memory/disk usage for Function Scan nodes in EXPLAIN
In-Reply-To: <E1xQdUc-000000008f8-36rI@gemulon.postgresql.org>
References: <E1xQdUc-000000008f8-36rI@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