diff options
author | David Rowley | 2024-07-05 02:05:08 +0000 |
---|---|---|
committer | David Rowley | 2024-07-05 02:05:08 +0000 |
commit | 1eff8279d494b96f0073df78abc74954a2f6ee54 (patch) | |
tree | ad0a2c26cc564a821be0a3ade446b3bfd861c604 /src/include/utils/tuplestore.h | |
parent | aa86129e19d704afb93cb84ab9638f33d266ee9d (diff) |
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
Diffstat (limited to 'src/include/utils/tuplestore.h')
-rw-r--r-- | src/include/utils/tuplestore.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/utils/tuplestore.h b/src/include/utils/tuplestore.h index 419613c17ba..3d8a90caaf9 100644 --- a/src/include/utils/tuplestore.h +++ b/src/include/utils/tuplestore.h @@ -65,6 +65,10 @@ extern void tuplestore_copy_read_pointer(Tuplestorestate *state, extern void tuplestore_trim(Tuplestorestate *state); +extern const char *tuplestore_storage_type_name(Tuplestorestate *state); + +extern int64 tuplestore_space_used(Tuplestorestate *state); + extern bool tuplestore_in_memory(Tuplestorestate *state); extern bool tuplestore_gettupleslot(Tuplestorestate *state, bool forward, |