diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2025-03-11 11:19:54 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2025-03-11 11:19:54 -0400 |
commit | 8b1b342544b69b281ffd3aafe594aec629ec4d3c (patch) | |
tree | 6239ec69a949ffb5397fc4f7a5f50128d446d477 /src/include/nodes | |
parent | 426ea611171da4e60ab4f3863fa3cc3683ae9547 (diff) | |
download | postgresql-8b1b342544b69b281ffd3aafe594aec629ec4d3c.tar.gz postgresql-8b1b342544b69b281ffd3aafe594aec629ec4d3c.zip |
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 <tgl@sss.pgh.pa.us>
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/144530.1741469955@sss.pgh.pa.us
Diffstat (limited to 'src/include/nodes')
-rw-r--r-- | src/include/nodes/plannodes.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h index bf1f25c0dba..22841211f48 100644 --- a/src/include/nodes/plannodes.h +++ b/src/include/nodes/plannodes.h @@ -1171,6 +1171,9 @@ typedef struct WindowAgg { Plan plan; + /* name of WindowClause implemented by this node */ + char *winname; + /* ID referenced by window functions */ Index winref; |