public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: [email protected]
Subject: pgsql: Improve EXPLAIN's display of window functions.
Date: Tue, 11 Mar 2025 15:20:01 +0000
Message-ID: <[email protected]> (raw)
Improve EXPLAIN's display of window functions.
Up to now we just punted on showing the window definitions used
in a plan, with window function calls represented as "OVER (?)".
To improve that, show the window definition implemented by each
WindowAgg plan node, and reference their window names in OVER.
For nameless window clauses generated by "OVER (...)", assign
unique names w1, w2, etc.
In passing, re-order the properties shown for a WindowAgg node
so that the Run Condition (if any) appears after the Window
property and before the Filter (if any). This seems more
sensible since the Run Condition is associated with the Window
and acts before the Filter.
Thanks to David G. Johnston and Álvaro Herrera for design
suggestions.
Author: Tom Lane <[email protected]>
Reviewed-by: David Rowley <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/8b1b342544b69b281ffd3aafe594aec629ec4d3c
Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out | 25 +-
src/backend/commands/explain.c | 117 +++++++-
src/backend/optimizer/plan/createplan.c | 39 +--
src/backend/optimizer/plan/planner.c | 51 ++++
src/backend/utils/adt/ruleutils.c | 150 ++++++++---
src/include/nodes/plannodes.h | 3 +
src/include/utils/ruleutils.h | 5 +
src/test/regress/expected/box.out | 14 +-
src/test/regress/expected/create_index_spgist.out | 42 +--
src/test/regress/expected/explain.out | 45 +++-
src/test/regress/expected/generated_virtual.out | 3 +-
src/test/regress/expected/groupingsets.out | 12 +-
src/test/regress/expected/partition_prune.out | 4 +-
src/test/regress/expected/polygon.out | 3 +-
src/test/regress/expected/select_parallel.out | 7 +-
src/test/regress/expected/sqljson.out | 18 +-
src/test/regress/expected/window.out | 308 +++++++++++++---------
src/test/regress/sql/explain.sql | 5 +
18 files changed, 598 insertions(+), 253 deletions(-)
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: [email protected]
Cc: [email protected], [email protected]
Subject: Re: pgsql: Improve EXPLAIN's display of window functions.
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox