pgsql: Adjust tuplestore stats API

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Adjust tuplestore stats API
Date: 2024-09-12 04:02:17
Message-ID: E1sob29-000gUO-EX@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Adjust tuplestore stats API

1eff8279d added an API to tuplestore.c to allow callers to obtain
storage telemetry data. That API wasn't quite good enough for callers
that perform tuplestore_clear() as the telemetry functions only
accounted for the current state of the tuplestore, not the maximums
before tuplestore_clear() was called.

There's a pending patch that would like to add tuplestore telemetry
output to EXPLAIN ANALYZE for WindowAgg. That node type uses
tuplestore_clear() before moving to the next window partition and we
want to show the maximum space used, not the space used for the final
partition.

Reviewed-by: Tatsuo Ishii, Ashutosh Bapat
Discussion: https://postgres/m/CAApHDvoY8cibGcicLV0fNh=9JVx9PANcWvhkdjBnDCc9Quqytg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9fba1ed2947382af213dfbfabfcd8898c89bf4ca

Modified Files
--------------
src/backend/commands/explain.c | 17 +++++-----
src/backend/utils/sort/tuplestore.c | 64 +++++++++++++++++++++----------------
src/include/utils/tuplestore.h | 5 ++-
3 files changed, 48 insertions(+), 38 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2024-09-12 04:32:18 pgsql: Move logic related to WAL replay of Heap/Heap2 into its own file
Previous Message Amit Langote 2024-09-12 01:55:57 pgsql: SQL/JSON: Fix JSON_QUERY(... WITH CONDITIONAL WRAPPER)