You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by yj...@apache.org on 2026/07/30 03:10:20 UTC
(cloudberry) 04/04: regress: ANALYZE nametbl to stabilize index_including IOS plan
This is an automated email from the ASF dual-hosted git repository.
yjhjstz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
commit d482b426f08c3b95fb56e00c7bd5ce086d3ee27b
Author: Jianghua Yang <yj...@gmail.com>
AuthorDate: Wed Jul 29 21:19:33 2026 +0800
regress: ANALYZE nametbl to stabilize index_including IOS plan
The nametbl covering-index test only did VACUUM FREEZE with no ANALYZE, so
with no column statistics GPORCA used default cardinalities and the plan
flipped between Index Only Scan and Index Scan across environments. Add
ANALYZE nametbl so the intended Index Only Scan plan is deterministic under
both optimizer=off and optimizer=on.
---
src/test/regress/expected/index_including.out | 1 +
src/test/regress/expected/index_including_optimizer.out | 1 +
src/test/regress/sql/index_including.sql | 1 +
3 files changed, 3 insertions(+)
diff --git a/src/test/regress/expected/index_including.out b/src/test/regress/expected/index_including.out
index 03b515b1e21..992c836395d 100644
--- a/src/test/regress/expected/index_including.out
+++ b/src/test/regress/expected/index_including.out
@@ -449,6 +449,7 @@ HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sur
CREATE INDEX nametbl_c1_c2_idx ON nametbl (c2, c1) INCLUDE (c3);
INSERT INTO nametbl SELECT x, 'two', 3.0 FROM generate_series(1,100) AS x;;
VACUUM FREEZE nametbl;
+ANALYZE nametbl;
SET enable_seqscan = 0;
-- Ensure we get an index only scan plan
EXPLAIN (COSTS OFF) SELECT c2, c1, c3 FROM nametbl WHERE c2 = 'two' AND c1 = 1;
diff --git a/src/test/regress/expected/index_including_optimizer.out b/src/test/regress/expected/index_including_optimizer.out
index 2b757917141..e53a1186782 100644
--- a/src/test/regress/expected/index_including_optimizer.out
+++ b/src/test/regress/expected/index_including_optimizer.out
@@ -417,6 +417,7 @@ CREATE TABLE nametbl (c1 int, c2 name, c3 float);
CREATE INDEX nametbl_c1_c2_idx ON nametbl (c2, c1) INCLUDE (c3);
INSERT INTO nametbl SELECT x, 'two', 3.0 FROM generate_series(1,100) AS x;;
VACUUM FREEZE nametbl;
+ANALYZE nametbl;
SET enable_seqscan = 0;
-- Ensure we get an index only scan plan
EXPLAIN (COSTS OFF) SELECT c2, c1, c3 FROM nametbl WHERE c2 = 'two' AND c1 = 1;
diff --git a/src/test/regress/sql/index_including.sql b/src/test/regress/sql/index_including.sql
index 039fe3d2432..8c55f839123 100644
--- a/src/test/regress/sql/index_including.sql
+++ b/src/test/regress/sql/index_including.sql
@@ -228,6 +228,7 @@ CREATE TABLE nametbl (c1 int, c2 name, c3 float);
CREATE INDEX nametbl_c1_c2_idx ON nametbl (c2, c1) INCLUDE (c3);
INSERT INTO nametbl SELECT x, 'two', 3.0 FROM generate_series(1,100) AS x;;
VACUUM FREEZE nametbl;
+ANALYZE nametbl;
SET enable_seqscan = 0;
-- Ensure we get an index only scan plan
EXPLAIN (COSTS OFF) SELECT c2, c1, c3 FROM nametbl WHERE c2 = 'two' AND c1 = 1;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org