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 <[email protected]>
Reviewed-by: Shashishekar Hullahally Anantharamu <[email protected]>
Reviewed-by: David Rowley <[email protected]>
Discussion: 
https://postgr.es/m/CAHza6qdpZTTjGJdzUmBkWbDPGB=gsz-vzwm5do-oim_nrja...@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 via email to