Prevent fallback when using array comparisons with btree indexes (#553)
We only support array comparison predicates on bitmap index scans, not on btree index scans or index scans of other types. However, ORCA was attempting to generate such plans, leading to a fallback to planner. With the fix, we will only consider bitmap indexes for array comparison predicates. This should avoid the fallback. Here is a simple test case: ``` drop table if exists foo; create table foo (a int, b int) distributed by (a); insert into foo values (1,1); create index foo_ix on foo using btree (b); set optimizer_print_plan to on; set client_min_messages to 'log'; -- before: btree index scan with an array comparison, fallback -- after: file scan with array comparison, ORCA plan explain select * from foo where b in (1, 3); -- before: btree index scan with array comparison, fallback, planner error in 5X -- after: file scan with array comparison, ORCA plan, succeeds in 5X explain update foo set a = 1 where b in (1, 3); ```
Showing
想要评论请 注册 或 登录