aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Korotkov <akorotkov@postgresql.org>2024-01-24 21:41:17 +0200
committerAlexander Korotkov <akorotkov@postgresql.org>2024-01-24 21:41:17 +0200
commitb91f918708283c1dc3dba8ff301f7d4b63c32e66 (patch)
tree46d3a3a1ac8e199b2e750b7d1b7e477f6cac529d
parent46a0cd4cefb4d9b462d8cc4df5e7ecdd190bea92 (diff)
downloadpostgresql-b91f918708283c1dc3dba8ff301f7d4b63c32e66.tar.gz
postgresql-b91f918708283c1dc3dba8ff301f7d4b63c32e66.zip
Rename index "abc" in aggregates.sql
In order to prevent name collision with table "abc" in namespace.sql. Reported-by: Nathan Bossart Discussion: https://postgr.es/m/20240124173735.GA2708416%40nathanxps13
-rw-r--r--src/test/regress/expected/aggregates.out56
-rw-r--r--src/test/regress/sql/aggregates.sql2
2 files changed, 29 insertions, 29 deletions
diff --git a/src/test/regress/expected/aggregates.out b/src/test/regress/expected/aggregates.out
index ac42b94ef10..7a73c19314b 100644
--- a/src/test/regress/expected/aggregates.out
+++ b/src/test/regress/expected/aggregates.out
@@ -2735,7 +2735,7 @@ CREATE TABLE btg AS SELECT
'abc' || i % 10 AS z,
i AS w
FROM generate_series(1,10000) AS i;
-CREATE INDEX abc ON btg(x,y);
+CREATE INDEX btg_x_y_idx ON btg(x,y);
ANALYZE btg;
-- GROUP BY optimization by reorder columns by frequency
SET enable_hashagg=off;
@@ -2743,92 +2743,92 @@ SET max_parallel_workers= 0;
SET max_parallel_workers_per_gather = 0;
-- Utilize index scan ordering to avoid a Sort operation
EXPLAIN (COSTS OFF) SELECT count(*) FROM btg GROUP BY x,y;
- QUERY PLAN
-----------------------------------------
+ QUERY PLAN
+------------------------------------------------
GroupAggregate
Group Key: x, y
- -> Index Only Scan using abc on btg
+ -> Index Only Scan using btg_x_y_idx on btg
(3 rows)
EXPLAIN (COSTS OFF) SELECT count(*) FROM btg GROUP BY y,x;
- QUERY PLAN
-----------------------------------------
+ QUERY PLAN
+------------------------------------------------
GroupAggregate
Group Key: x, y
- -> Index Only Scan using abc on btg
+ -> Index Only Scan using btg_x_y_idx on btg
(3 rows)
-- Engage incremental sort
explain (COSTS OFF) SELECT x,y FROM btg GROUP BY x,y,z,w;
- QUERY PLAN
------------------------------------------
+ QUERY PLAN
+-------------------------------------------------
Group
Group Key: x, y, z, w
-> Incremental Sort
Sort Key: x, y, z, w
Presorted Key: x, y
- -> Index Scan using abc on btg
+ -> Index Scan using btg_x_y_idx on btg
(6 rows)
explain (COSTS OFF) SELECT x,y FROM btg GROUP BY z,y,w,x;
- QUERY PLAN
------------------------------------------
+ QUERY PLAN
+-------------------------------------------------
Group
Group Key: x, y, z, w
-> Incremental Sort
Sort Key: x, y, z, w
Presorted Key: x, y
- -> Index Scan using abc on btg
+ -> Index Scan using btg_x_y_idx on btg
(6 rows)
explain (COSTS OFF) SELECT x,y FROM btg GROUP BY w,z,x,y;
- QUERY PLAN
------------------------------------------
+ QUERY PLAN
+-------------------------------------------------
Group
Group Key: x, y, w, z
-> Incremental Sort
Sort Key: x, y, w, z
Presorted Key: x, y
- -> Index Scan using abc on btg
+ -> Index Scan using btg_x_y_idx on btg
(6 rows)
explain (COSTS OFF) SELECT x,y FROM btg GROUP BY w,x,z,y;
- QUERY PLAN
------------------------------------------
+ QUERY PLAN
+-------------------------------------------------
Group
Group Key: x, y, w, z
-> Incremental Sort
Sort Key: x, y, w, z
Presorted Key: x, y
- -> Index Scan using abc on btg
+ -> Index Scan using btg_x_y_idx on btg
(6 rows)
-- Subqueries
explain (COSTS OFF) SELECT x,y
FROM (SELECT * FROM btg ORDER BY x,y,w,z) AS q1
GROUP BY (w,x,z,y);
- QUERY PLAN
-----------------------------------------------
+ QUERY PLAN
+-------------------------------------------------
Group
Group Key: btg.x, btg.y, btg.w, btg.z
-> Incremental Sort
Sort Key: btg.x, btg.y, btg.w, btg.z
Presorted Key: btg.x, btg.y
- -> Index Scan using abc on btg
+ -> Index Scan using btg_x_y_idx on btg
(6 rows)
explain (COSTS OFF) SELECT x,y
FROM (SELECT * FROM btg ORDER BY x,y,w,z LIMIT 100) AS q1
GROUP BY (w,x,z,y);
- QUERY PLAN
-----------------------------------------------------
+ QUERY PLAN
+-------------------------------------------------------
Group
Group Key: btg.x, btg.y, btg.w, btg.z
-> Limit
-> Incremental Sort
Sort Key: btg.x, btg.y, btg.w, btg.z
Presorted Key: btg.x, btg.y
- -> Index Scan using abc on btg
+ -> Index Scan using btg_x_y_idx on btg
(7 rows)
-- Should work with and without GROUP-BY optimization
@@ -2844,8 +2844,8 @@ explain (COSTS OFF) SELECT x,y FROM btg GROUP BY w,x,z,y ORDER BY y,x,z,w;
-- Utilize incremental sort to make the ORDER BY rule a bit cheaper
explain (COSTS OFF) SELECT x,w FROM btg GROUP BY w,x,y,z ORDER BY x*x,z;
- QUERY PLAN
------------------------------------------------
+ QUERY PLAN
+-------------------------------------------------------
Sort
Sort Key: ((x * x)), z
-> Group
@@ -2853,7 +2853,7 @@ explain (COSTS OFF) SELECT x,w FROM btg GROUP BY w,x,y,z ORDER BY x*x,z;
-> Incremental Sort
Sort Key: x, y, w, z
Presorted Key: x, y
- -> Index Scan using abc on btg
+ -> Index Scan using btg_x_y_idx on btg
(8 rows)
SET enable_incremental_sort = off;
diff --git a/src/test/regress/sql/aggregates.sql b/src/test/regress/sql/aggregates.sql
index c2b3e162267..916dbf908f7 100644
--- a/src/test/regress/sql/aggregates.sql
+++ b/src/test/regress/sql/aggregates.sql
@@ -1188,7 +1188,7 @@ CREATE TABLE btg AS SELECT
'abc' || i % 10 AS z,
i AS w
FROM generate_series(1,10000) AS i;
-CREATE INDEX abc ON btg(x,y);
+CREATE INDEX btg_x_y_idx ON btg(x,y);
ANALYZE btg;
-- GROUP BY optimization by reorder columns by frequency