Skip to content

Commit 6841118

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 f1c1baf commit 6841118

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
@@ -1406,10 +1406,10 @@ GROUP BY GROUPING SETS (
14061406

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

0 commit comments

Comments
 (0)