pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add memory/disk usage for Material nodes in EXPLAIN
Date: Fri, 05 Jul 2024 02:05:29 +0000
Message-ID: <E1sPYKG-000MG7-F1@gemulon.postgresql.org> (raw)

Add memory/disk usage for Material nodes in EXPLAIN

Up until now, there was no ability to easily determine if a Material
node caused the underlying tuplestore to spill to disk or even see how
much memory the tuplestore used if it didn't.

Here we add some new functions to tuplestore.c to query this information
and add some additional output in EXPLAIN ANALYZE to display this
information for the Material node.

There are a few other executor node types that use tuplestores, so we
could also consider adding these details to the EXPLAIN ANALYZE for
those nodes too.  Let's consider those independently from this.  Having
the tuplestore.c infrastructure in to allow that is step 1.

Author: David Rowley
Reviewed-by: Matthias van de Meent, Dmitry Dolgov
Discussion: https://postgr.es/m/CAApHDvp5Py9g4Rjq7_inL3-MCK1Co2CRt_YWFwTU2zfQix0p4A@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1eff8279d494b96f0073df78abc74954a2f6ee54

Modified Files
--------------
src/backend/commands/explain.c                | 37 +++++++++++++++++++
src/backend/utils/sort/tuplestore.c           | 53 +++++++++++++++++++++++++++
src/include/utils/tuplestore.h                |  4 ++
src/test/regress/expected/partition_prune.out | 37 +++++++++++++++----
src/test/regress/sql/partition_prune.sql      | 29 +++++++++++++--
5 files changed, 148 insertions(+), 12 deletions(-)



Message-ID: <E1sPYKG-000MG7-F1@gemulon.postgresql.org>
Permalink:  ../E1sPYKG-000MG7-F1@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1sPYKG-000MG7-F1@gemulon.postgresql.org

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: drowley@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add memory/disk usage for Material nodes in EXPLAIN
  In-Reply-To: <E1sPYKG-000MG7-F1@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