Skip to content

Commit e7d29d1

Browse files
committed
Doc: improve description of window function processing.
The previous wording talked about a "single pass over the data", which can be read as promising more than intended (to wit, that only one WindowAgg plan node will be used). What we promise is only what the SQL spec requires, namely that the data not get re-sorted between window functions with compatible PARTITION BY/ORDER BY clauses. Adjust the wording in hopes of making this clearer. Reported-by: Christopher Inokuchi <cinokuchi@gmail.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: David G. Johnston <david.g.johnston@gmail.com> Discussion: https://postgr.es/m/CABde6B5va2wMsnM79u_x=n9KUgfKQje_pbLROEBmA9Ru5XWidw@mail.gmail.com Backpatch-through: 13
1 parent da85544 commit e7d29d1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/src/sgml/queries.sgml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,10 +1455,10 @@ GROUP BY GROUPING SETS (
14551455

14561456
<para>
14571457
When multiple window functions are used, all the window functions having
1458-
syntactically equivalent <literal>PARTITION BY</literal> and <literal>ORDER BY</literal>
1459-
clauses in their window definitions are guaranteed to be evaluated in a
1460-
single pass over the data. Therefore they will see the same sort ordering,
1461-
even if the <literal>ORDER BY</literal> does not uniquely determine an ordering.
1458+
equivalent <literal>PARTITION BY</literal> and <literal>ORDER BY</literal>
1459+
clauses in their window definitions are guaranteed to see the same
1460+
ordering of the input rows, even if the <literal>ORDER BY</literal> does
1461+
not uniquely determine the ordering.
14621462
However, no guarantees are made about the evaluation of functions having
14631463
different <literal>PARTITION BY</literal> or <literal>ORDER BY</literal> specifications.
14641464
(In such cases a sort step is typically required between the passes of

0 commit comments

Comments
 (0)