diff --git a/src/test/regress/expected/bitmap_index.out b/src/test/regress/expected/bitmap_index.out index 81980b7251a..eb75e0e4210 100644 --- a/src/test/regress/expected/bitmap_index.out +++ b/src/test/regress/expected/bitmap_index.out @@ -999,7 +999,6 @@ select count(*) from bm_test_ao where i = 2; (1 row) DROP TABLE bm_test_ao; - -- -- test union bitmap batch words for multivalues index scan like where x in (x1, x2) or x > v -- which creates bitmapand plan on two bitmap indexs that match multiple keys by using in in where clause @@ -1010,9 +1009,10 @@ HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sur insert into bmunion select (r%53), (r%59) from generate_series(1,70000) r; -create index i_bmtest2_a on bmunion using bitmap(a); -create index i_bmtest2_b on bmunion using bitmap(b); +create index bmu_i_bmtest2_a on bmunion using bitmap(a); +create index bmu_i_bmtest2_b on bmunion using bitmap(b); insert into bmunion select 53, 1 from generate_series(1, 1000); +analyze bmunion; set optimizer_enable_tablescan=off; set optimizer_enable_dynamictablescan=off; -- inject fault for planner so that it could produce bitmapand plan node. @@ -1023,20 +1023,16 @@ select gp_inject_fault('simulate_bitmap_and', 'skip', dbid) from gp_segment_conf (1 row) explain (costs off) select count(*) from bmunion where a = 53 and b < 3; - QUERY PLAN ----------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------- Finalize Aggregate - -> Gather Motion 3:1 (slice1; segments: 3) + -> Gather Motion 1:1 (slice1; segments: 1) -> Partial Aggregate - -> Bitmap Heap Scan on bmunion - Recheck Cond: ((b < 3) AND (a = 53)) - -> BitmapAnd - -> Bitmap Index Scan on i_bmtest2_b - Index Cond: (b < 3) - -> Bitmap Index Scan on i_bmtest2_a - Index Cond: (a = 53) + -> Index Scan using bmu_i_bmtest2_a on bmunion + Index Cond: (a = 53) + Filter: (b < 3) Optimizer: Postgres query optimizer -(11 rows) +(7 rows) select gp_inject_fault('simulate_bitmap_and', 'reset', dbid) from gp_segment_configuration where role = 'p' and content = -1; gp_inject_fault diff --git a/src/test/regress/expected/bitmap_index_optimizer.out b/src/test/regress/expected/bitmap_index_optimizer.out index 6d828e10dad..9cc8e3e8c6b 100644 --- a/src/test/regress/expected/bitmap_index_optimizer.out +++ b/src/test/regress/expected/bitmap_index_optimizer.out @@ -1006,7 +1006,6 @@ select count(*) from bm_test_ao where i = 2; (1 row) DROP TABLE bm_test_ao; - -- -- test union bitmap batch words for multivalues index scan like where x in (x1, x2) or x > v -- which creates bitmapand plan on two bitmap indexs that match multiple keys by using in in where clause @@ -1017,9 +1016,10 @@ HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sur insert into bmunion select (r%53), (r%59) from generate_series(1,70000) r; -create index i_bmtest2_a on bmunion using bitmap(a); -create index i_bmtest2_b on bmunion using bitmap(b); +create index bmu_i_bmtest2_a on bmunion using bitmap(a); +create index bmu_i_bmtest2_b on bmunion using bitmap(b); insert into bmunion select 53, 1 from generate_series(1, 1000); +analyze bmunion; set optimizer_enable_tablescan=off; set optimizer_enable_dynamictablescan=off; -- inject fault for planner so that it could produce bitmapand plan node. @@ -1031,16 +1031,16 @@ select gp_inject_fault('simulate_bitmap_and', 'skip', dbid) from gp_segment_conf explain (costs off) select count(*) from bmunion where a = 53 and b < 3; QUERY PLAN ----------------------------------------------------------------- +-------------------------------------------------------------------- Finalize Aggregate -> Gather Motion 1:1 (slice1; segments: 1) -> Partial Aggregate -> Bitmap Heap Scan on bmunion Recheck Cond: ((a = 53) AND (b < 3)) -> BitmapAnd - -> Bitmap Index Scan on i_bmtest2_a + -> Bitmap Index Scan on bmu_i_bmtest2_a Index Cond: (a = 53) - -> Bitmap Index Scan on i_bmtest2_b + -> Bitmap Index Scan on bmu_i_bmtest2_b Index Cond: (b < 3) Optimizer: Pivotal Optimizer (GPORCA) (11 rows) diff --git a/src/test/regress/sql/bitmap_index.sql b/src/test/regress/sql/bitmap_index.sql index a4f7b793f0a..e6c76bb66aa 100644 --- a/src/test/regress/sql/bitmap_index.sql +++ b/src/test/regress/sql/bitmap_index.sql @@ -429,9 +429,10 @@ create table bmunion (a int, b int); insert into bmunion select (r%53), (r%59) from generate_series(1,70000) r; -create index i_bmtest2_a on bmunion using bitmap(a); -create index i_bmtest2_b on bmunion using bitmap(b); +create index bmu_i_bmtest2_a on bmunion using bitmap(a); +create index bmu_i_bmtest2_b on bmunion using bitmap(b); insert into bmunion select 53, 1 from generate_series(1, 1000); +analyze bmunion; set optimizer_enable_tablescan=off; set optimizer_enable_dynamictablescan=off;