[fix](planner)use base index if the where clause is a constant value (#18367)
sql : select bitmap_empty() from d_table where true; should always use base index instead of any mv, because the conjuncts is constant (true) and use none of the column from any mv
This commit is contained in:
@ -474,7 +474,9 @@ public class OlapScanNode extends ScanNode {
|
||||
if (mvColumn == null) {
|
||||
boolean isBound = false;
|
||||
for (Expr conjunct : conjuncts) {
|
||||
if (conjunct.isBound(slotDescriptor.getId())) {
|
||||
List<TupleId> tids = Lists.newArrayList();
|
||||
conjunct.getIds(tids, null);
|
||||
if (!tids.isEmpty() && conjunct.isBound(slotDescriptor.getId())) {
|
||||
isBound = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -39,3 +39,11 @@
|
||||
2 4
|
||||
2 4
|
||||
|
||||
-- !select_mv_constant --
|
||||
\N
|
||||
\N
|
||||
\N
|
||||
\N
|
||||
\N
|
||||
\N
|
||||
|
||||
|
||||
@ -86,4 +86,6 @@ suite ("k123p") {
|
||||
contains "(k123p4w)"
|
||||
}
|
||||
qt_select_mv """select k1,k2+k3 from d_table where k1 = 2 and k4 = "b" order by k1;"""
|
||||
|
||||
qt_select_mv_constant """select bitmap_empty() from d_table where true;"""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user