summaryrefslogtreecommitdiff
path: root/src/test/regress/expected/window.out
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/regress/expected/window.out')
-rw-r--r--src/test/regress/expected/window.out26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/test/regress/expected/window.out b/src/test/regress/expected/window.out
index a595fa28ce1..9e2f53726f5 100644
--- a/src/test/regress/expected/window.out
+++ b/src/test/regress/expected/window.out
@@ -4250,14 +4250,14 @@ SELECT 1 FROM
(SELECT ntile(s1.x) OVER () AS c
FROM (SELECT (SELECT 1) AS x) AS s1) s
WHERE s.c = 1;
- QUERY PLAN
-----------------------------------------------------------------
+ QUERY PLAN
+---------------------------------------------------------------------
Subquery Scan on s
Filter: (s.c = 1)
-> WindowAgg
Window: w1 AS (ROWS UNBOUNDED PRECEDING)
- Run Condition: (ntile((InitPlan 1).col1) OVER w1 <= 1)
- InitPlan 1
+ Run Condition: (ntile((InitPlan expr_1).col1) OVER w1 <= 1)
+ InitPlan expr_1
-> Result
-> Result
(8 rows)
@@ -4338,7 +4338,7 @@ WHERE c = 1;
Filter: (emp.c = 1)
-> WindowAgg
Window: w1 AS (ORDER BY empsalary.empno)
- InitPlan 1
+ InitPlan expr_1
-> Result
-> Sort
Sort Key: empsalary.empno DESC
@@ -4537,6 +4537,22 @@ WHERE first_emp = 1 OR last_emp = 1;
sales | 4 | 4800 | 08-08-2007 | 3 | 1
(6 rows)
+CREATE INDEX empsalary_salary_empno_idx ON empsalary (salary, empno);
+SET enable_seqscan = 0;
+-- Ensure no sorting is done and that the IndexScan maintains all pathkeys
+-- useful for the final sort order.
+EXPLAIN (COSTS OFF)
+SELECT salary, empno, row_number() OVER (ORDER BY salary) rn
+FROM empsalary
+ORDER BY salary, empno;
+ QUERY PLAN
+---------------------------------------------------------------------
+ WindowAgg
+ Window: w1 AS (ORDER BY salary ROWS UNBOUNDED PRECEDING)
+ -> Index Only Scan using empsalary_salary_empno_idx on empsalary
+(3 rows)
+
+RESET enable_seqscan;
-- cleanup
DROP TABLE empsalary;
-- test user-defined window function with named args and default args