This is an automated email from the ASF dual-hosted git repository. leborchuk pushed a commit to branch REL_2_STABLE in repository https://gitbox.apache.org/repos/asf/cloudberry.git
commit 12de2147d7f314768f84151c2869d4381f9f753d Author: reshke <[email protected]> AuthorDate: Fri Sep 25 15:33:52 2026 +0300 Backport fixup: make indexing expected match GP plans for BRIN/SPGIST/GIN partitioned index tests; add optimizer variant --- src/test/regress/expected/indexing.out | 51 ++++++++++-------- .../{indexing.out => indexing_optimizer.out} | 60 ++++++++++++++-------- 2 files changed, 69 insertions(+), 42 deletions(-) diff --git a/src/test/regress/expected/indexing.out b/src/test/regress/expected/indexing.out index 1143ad9ce92..c0ae9c1209c 100644 --- a/src/test/regress/expected/indexing.out +++ b/src/test/regress/expected/indexing.out @@ -1305,39 +1305,48 @@ select tableoid::regclass, * from idxpart order by a; drop table idxpart; -- Test some other non-btree index types create table idxpart (a int, b text, c int[]) partition by range (a); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Apache Cloudberry data distribution key for this table. +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. create table idxpart1 partition of idxpart for values from (0) to (100000); +NOTICE: table has parent, setting distribution columns to match parent table set enable_seqscan to off; create index idxpart_brin on idxpart using brin(b); explain (costs off) select * from idxpart where b = 'abcd'; - QUERY PLAN -------------------------------------------- - Bitmap Heap Scan on idxpart1 idxpart - Recheck Cond: (b = 'abcd'::text) - -> Bitmap Index Scan on idxpart1_b_idx - Index Cond: (b = 'abcd'::text) -(4 rows) + QUERY PLAN +------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Bitmap Heap Scan on idxpart1 idxpart + Recheck Cond: (b = 'abcd'::text) + -> Bitmap Index Scan on idxpart1_b_idx + Index Cond: (b = 'abcd'::text) + Optimizer: Postgres query optimizer +(6 rows) drop index idxpart_brin; create index idxpart_spgist on idxpart using spgist(b); explain (costs off) select * from idxpart where b = 'abcd'; - QUERY PLAN -------------------------------------------- - Bitmap Heap Scan on idxpart1 idxpart - Recheck Cond: (b = 'abcd'::text) - -> Bitmap Index Scan on idxpart1_b_idx - Index Cond: (b = 'abcd'::text) -(4 rows) + QUERY PLAN +------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Bitmap Heap Scan on idxpart1 idxpart + Recheck Cond: (b = 'abcd'::text) + -> Bitmap Index Scan on idxpart1_b_idx + Index Cond: (b = 'abcd'::text) + Optimizer: Postgres query optimizer +(6 rows) drop index idxpart_spgist; create index idxpart_gin on idxpart using gin(c); explain (costs off) select * from idxpart where c @> array[42]; - QUERY PLAN ----------------------------------------------- - Bitmap Heap Scan on idxpart1 idxpart - Recheck Cond: (c @> '{42}'::integer[]) - -> Bitmap Index Scan on idxpart1_c_idx - Index Cond: (c @> '{42}'::integer[]) -(4 rows) + QUERY PLAN +---------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Bitmap Heap Scan on idxpart1 idxpart + Recheck Cond: (c @> '{42}'::integer[]) + -> Bitmap Index Scan on idxpart1_c_idx + Index Cond: (c @> '{42}'::integer[]) + Optimizer: Postgres query optimizer +(6 rows) drop index idxpart_gin; reset enable_seqscan; diff --git a/src/test/regress/expected/indexing.out b/src/test/regress/expected/indexing_optimizer.out similarity index 97% copy from src/test/regress/expected/indexing.out copy to src/test/regress/expected/indexing_optimizer.out index 1143ad9ce92..c528367b6a1 100644 --- a/src/test/regress/expected/indexing.out +++ b/src/test/regress/expected/indexing_optimizer.out @@ -1305,39 +1305,57 @@ select tableoid::regclass, * from idxpart order by a; drop table idxpart; -- Test some other non-btree index types create table idxpart (a int, b text, c int[]) partition by range (a); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Apache Cloudberry data distribution key for this table. +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. create table idxpart1 partition of idxpart for values from (0) to (100000); +NOTICE: table has parent, setting distribution columns to match parent table set enable_seqscan to off; create index idxpart_brin on idxpart using brin(b); explain (costs off) select * from idxpart where b = 'abcd'; - QUERY PLAN -------------------------------------------- - Bitmap Heap Scan on idxpart1 idxpart - Recheck Cond: (b = 'abcd'::text) - -> Bitmap Index Scan on idxpart1_b_idx - Index Cond: (b = 'abcd'::text) -(4 rows) +NOTICE: One or more columns in the following table(s) do not have statistics: idxpart +HINT: For non-partitioned tables, run analyze <table_name>(<column_list>). For partitioned tables, run analyze rootpartition <table_name>(<column_list>). See log for columns missing statistics. + QUERY PLAN +------------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Dynamic Bitmap Heap Scan on idxpart + Number of partitions to scan: 1 (out of 1) + Recheck Cond: (b = 'abcd'::text) + Filter: (b = 'abcd'::text) + -> Dynamic Bitmap Index Scan on idxpart_brin + Index Cond: (b = 'abcd'::text) + Optimizer: GPORCA +(8 rows) drop index idxpart_brin; create index idxpart_spgist on idxpart using spgist(b); explain (costs off) select * from idxpart where b = 'abcd'; - QUERY PLAN -------------------------------------------- - Bitmap Heap Scan on idxpart1 idxpart - Recheck Cond: (b = 'abcd'::text) - -> Bitmap Index Scan on idxpart1_b_idx - Index Cond: (b = 'abcd'::text) -(4 rows) +NOTICE: One or more columns in the following table(s) do not have statistics: idxpart +HINT: For non-partitioned tables, run analyze <table_name>(<column_list>). For partitioned tables, run analyze rootpartition <table_name>(<column_list>). See log for columns missing statistics. + QUERY PLAN +---------------------------------------------------- + Gather Motion 3:1 (slice1; segments: 3) + -> Dynamic Seq Scan on idxpart + Number of partitions to scan: 1 (out of 1) + Filter: (b = 'abcd'::text) + Optimizer: GPORCA +(5 rows) drop index idxpart_spgist; create index idxpart_gin on idxpart using gin(c); explain (costs off) select * from idxpart where c @> array[42]; - QUERY PLAN ----------------------------------------------- - Bitmap Heap Scan on idxpart1 idxpart - Recheck Cond: (c @> '{42}'::integer[]) - -> Bitmap Index Scan on idxpart1_c_idx - Index Cond: (c @> '{42}'::integer[]) -(4 rows) +NOTICE: One or more columns in the following table(s) do not have statistics: idxpart +HINT: For non-partitioned tables, run analyze <table_name>(<column_list>). For partitioned tables, run analyze rootpartition <table_name>(<column_list>). See log for columns missing statistics. + QUERY PLAN +------------------------------------------------------ + Gather Motion 3:1 (slice1; segments: 3) + -> Dynamic Bitmap Heap Scan on idxpart + Number of partitions to scan: 1 (out of 1) + Recheck Cond: (c @> '{42}'::integer[]) + Filter: (c @> '{42}'::integer[]) + -> Dynamic Bitmap Index Scan on idxpart_gin + Index Cond: (c @> '{42}'::integer[]) + Optimizer: GPORCA +(8 rows) drop index idxpart_gin; reset enable_seqscan; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
