Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite15e567

Browse files
author
Richard Guo
committed
Fix test case froma8ccf4e
Commita8ccf4e uses the same table name "distinct_tbl" in bothselect_distinct.sql and select_distinct_on.sql, which could causeconflicts when these two test scripts are run in parallel.Fix by renaming the table in select_distinct_on.sql to"distinct_on_tbl".Per buildfarm (via Tom Lane)Discussion:https://postgr.es/m/1572004.1732583549@sss.pgh.pa.us
1 parent91f5a4a commite15e567

File tree

2 files changed

+39
-39
lines changed

2 files changed

+39
-39
lines changed

‎src/test/regress/expected/select_distinct_on.out

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -125,23 +125,23 @@ SELECT DISTINCT ON (four) four,hundred
125125
-- Test the planner's ability to reorder the distinctClause Pathkeys to match
126126
-- the input path's ordering
127127
--
128-
CREATE TABLEdistinct_tbl (x int, y int, z int);
129-
INSERT INTOdistinct_tbl SELECT i%10, i%10, i%10 FROM generate_series(1, 1000) AS i;
130-
CREATE INDEXdistinct_tbl_x_y_idx ONdistinct_tbl (x, y);
131-
ANALYZEdistinct_tbl;
128+
CREATE TABLEdistinct_on_tbl (x int, y int, z int);
129+
INSERT INTOdistinct_on_tbl SELECT i%10, i%10, i%10 FROM generate_series(1, 1000) AS i;
130+
CREATE INDEXdistinct_on_tbl_x_y_idx ONdistinct_on_tbl (x, y);
131+
ANALYZEdistinct_on_tbl;
132132
-- Produce results with sorting.
133133
SET enable_hashagg TO OFF;
134134
-- Ensure we avoid the need to re-sort by reordering the distinctClause
135135
-- Pathkeys to match the ordering of the input path
136136
EXPLAIN (COSTS OFF)
137-
SELECT DISTINCT ON (y, x) x, y FROMdistinct_tbl;
138-
QUERY PLAN
139-
------------------------------------------------------------------
137+
SELECT DISTINCT ON (y, x) x, y FROMdistinct_on_tbl;
138+
QUERY PLAN
139+
------------------------------------------------------------------------
140140
Unique
141-
-> Index Only Scan usingdistinct_tbl_x_y_idx ondistinct_tbl
141+
-> Index Only Scan usingdistinct_on_tbl_x_y_idx ondistinct_on_tbl
142142
(2 rows)
143143

144-
SELECT DISTINCT ON (y, x) x, y FROMdistinct_tbl;
144+
SELECT DISTINCT ON (y, x) x, y FROMdistinct_on_tbl;
145145
x | y
146146
---+---
147147
0 | 0
@@ -159,18 +159,18 @@ SELECT DISTINCT ON (y, x) x, y FROM distinct_tbl;
159159
-- Ensure we leverage incremental-sort by reordering the distinctClause
160160
-- Pathkeys to partially match the ordering of the input path
161161
EXPLAIN (COSTS OFF)
162-
SELECT DISTINCT ON (y, x) x, y FROM (SELECT * FROMdistinct_tbl ORDER BY x) s;
163-
QUERY PLAN
164-
------------------------------------------------------------------------------
162+
SELECT DISTINCT ON (y, x) x, y FROM (SELECT * FROMdistinct_on_tbl ORDER BY x) s;
163+
QUERY PLAN
164+
------------------------------------------------------------------------------------
165165
Unique
166166
-> Incremental Sort
167167
Sort Key: s.x, s.y
168168
Presorted Key: s.x
169169
-> Subquery Scan on s
170-
-> Index Only Scan usingdistinct_tbl_x_y_idx ondistinct_tbl
170+
-> Index Only Scan usingdistinct_on_tbl_x_y_idx ondistinct_on_tbl
171171
(6 rows)
172172

173-
SELECT DISTINCT ON (y, x) x, y FROM (SELECT * FROMdistinct_tbl ORDER BY x) s;
173+
SELECT DISTINCT ON (y, x) x, y FROM (SELECT * FROMdistinct_on_tbl ORDER BY x) s;
174174
x | y
175175
---+---
176176
0 | 0
@@ -188,16 +188,16 @@ SELECT DISTINCT ON (y, x) x, y FROM (SELECT * FROM distinct_tbl ORDER BY x) s;
188188
-- Ensure we reorder the distinctClause Pathkeys to match the ordering of the
189189
-- input path even if there is ORDER BY clause
190190
EXPLAIN (COSTS OFF)
191-
SELECT DISTINCT ON (y, x) x, y FROMdistinct_tbl ORDER BY y;
192-
QUERY PLAN
193-
------------------------------------------------------------------------
191+
SELECT DISTINCT ON (y, x) x, y FROMdistinct_on_tbl ORDER BY y;
192+
QUERY PLAN
193+
------------------------------------------------------------------------------
194194
Sort
195195
Sort Key: y
196196
-> Unique
197-
-> Index Only Scan usingdistinct_tbl_x_y_idx ondistinct_tbl
197+
-> Index Only Scan usingdistinct_on_tbl_x_y_idx ondistinct_on_tbl
198198
(4 rows)
199199

200-
SELECT DISTINCT ON (y, x) x, y FROMdistinct_tbl ORDER BY y;
200+
SELECT DISTINCT ON (y, x) x, y FROMdistinct_on_tbl ORDER BY y;
201201
x | y
202202
---+---
203203
0 | 0
@@ -214,9 +214,9 @@ SELECT DISTINCT ON (y, x) x, y FROM distinct_tbl ORDER BY y;
214214

215215
-- Ensure the resulting pathkey list matches the initial distinctClause Pathkeys
216216
EXPLAIN (COSTS OFF)
217-
SELECT DISTINCT ON (y, x) x, y FROM (select * fromdistinct_tbl order by x, z, y) s ORDER BY y, x, z;
218-
QUERY PLAN
219-
------------------------------------------------------------------------------------
217+
SELECT DISTINCT ON (y, x) x, y FROM (select * fromdistinct_on_tbl order by x, z, y) s ORDER BY y, x, z;
218+
QUERY PLAN
219+
---------------------------------------------------------------------------------------------
220220
Sort
221221
Sort Key: s.y, s.x, s.z
222222
-> Unique
@@ -225,11 +225,11 @@ SELECT DISTINCT ON (y, x) x, y FROM (select * from distinct_tbl order by x, z, y
225225
Presorted Key: s.x
226226
-> Subquery Scan on s
227227
-> Sort
228-
Sort Key:distinct_tbl.x,distinct_tbl.z,distinct_tbl.y
229-
-> Seq Scan ondistinct_tbl
228+
Sort Key:distinct_on_tbl.x,distinct_on_tbl.z,distinct_on_tbl.y
229+
-> Seq Scan ondistinct_on_tbl
230230
(10 rows)
231231

232-
SELECT DISTINCT ON (y, x) x, y FROM (select * fromdistinct_tbl order by x, z, y) s ORDER BY y, x, z;
232+
SELECT DISTINCT ON (y, x) x, y FROM (select * fromdistinct_on_tbl order by x, z, y) s ORDER BY y, x, z;
233233
x | y
234234
---+---
235235
0 | 0
@@ -245,4 +245,4 @@ SELECT DISTINCT ON (y, x) x, y FROM (select * from distinct_tbl order by x, z, y
245245
(10 rows)
246246

247247
RESET enable_hashagg;
248-
DROP TABLEdistinct_tbl;
248+
DROP TABLEdistinct_on_tbl;

‎src/test/regress/sql/select_distinct_on.sql

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,37 +48,37 @@ SELECT DISTINCT ON (four) four,hundred
4848
-- the input path's ordering
4949
--
5050

51-
CREATETABLEdistinct_tbl (xint, yint, zint);
52-
INSERT INTOdistinct_tblSELECT i%10, i%10, i%10FROM generate_series(1,1000)AS i;
53-
CREATEINDEXdistinct_tbl_x_y_idxONdistinct_tbl (x, y);
54-
ANALYZEdistinct_tbl;
51+
CREATETABLEdistinct_on_tbl (xint, yint, zint);
52+
INSERT INTOdistinct_on_tblSELECT i%10, i%10, i%10FROM generate_series(1,1000)AS i;
53+
CREATEINDEXdistinct_on_tbl_x_y_idxONdistinct_on_tbl (x, y);
54+
ANALYZEdistinct_on_tbl;
5555

5656
-- Produce results with sorting.
5757
SET enable_hashagg TO OFF;
5858

5959
-- Ensure we avoid the need to re-sort by reordering the distinctClause
6060
-- Pathkeys to match the ordering of the input path
6161
EXPLAIN (COSTS OFF)
62-
SELECT DISTINCTON (y, x) x, yFROMdistinct_tbl;
63-
SELECT DISTINCTON (y, x) x, yFROMdistinct_tbl;
62+
SELECT DISTINCTON (y, x) x, yFROMdistinct_on_tbl;
63+
SELECT DISTINCTON (y, x) x, yFROMdistinct_on_tbl;
6464

6565
-- Ensure we leverage incremental-sort by reordering the distinctClause
6666
-- Pathkeys to partially match the ordering of the input path
6767
EXPLAIN (COSTS OFF)
68-
SELECT DISTINCTON (y, x) x, yFROM (SELECT*FROMdistinct_tblORDER BY x) s;
69-
SELECT DISTINCTON (y, x) x, yFROM (SELECT*FROMdistinct_tblORDER BY x) s;
68+
SELECT DISTINCTON (y, x) x, yFROM (SELECT*FROMdistinct_on_tblORDER BY x) s;
69+
SELECT DISTINCTON (y, x) x, yFROM (SELECT*FROMdistinct_on_tblORDER BY x) s;
7070

7171
-- Ensure we reorder the distinctClause Pathkeys to match the ordering of the
7272
-- input path even if there is ORDER BY clause
7373
EXPLAIN (COSTS OFF)
74-
SELECT DISTINCTON (y, x) x, yFROMdistinct_tblORDER BY y;
75-
SELECT DISTINCTON (y, x) x, yFROMdistinct_tblORDER BY y;
74+
SELECT DISTINCTON (y, x) x, yFROMdistinct_on_tblORDER BY y;
75+
SELECT DISTINCTON (y, x) x, yFROMdistinct_on_tblORDER BY y;
7676

7777
-- Ensure the resulting pathkey list matches the initial distinctClause Pathkeys
7878
EXPLAIN (COSTS OFF)
79-
SELECT DISTINCTON (y, x) x, yFROM (select*fromdistinct_tblorder by x, z, y) sORDER BY y, x, z;
80-
SELECT DISTINCTON (y, x) x, yFROM (select*fromdistinct_tblorder by x, z, y) sORDER BY y, x, z;
79+
SELECT DISTINCTON (y, x) x, yFROM (select*fromdistinct_on_tblorder by x, z, y) sORDER BY y, x, z;
80+
SELECT DISTINCTON (y, x) x, yFROM (select*fromdistinct_on_tblorder by x, z, y) sORDER BY y, x, z;
8181

8282
RESET enable_hashagg;
8383

84-
DROPTABLEdistinct_tbl;
84+
DROPTABLEdistinct_on_tbl;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp