You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by kx...@apache.org on 2024/02/07 13:49:05 UTC
(doris) branch branch-2.0 updated: [fix](index) disable OR predicate for bitmap index (#30971)
This is an automated email from the ASF dual-hosted git repository.
kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 1982bf57db7 [fix](index) disable OR predicate for bitmap index (#30971)
1982bf57db7 is described below
commit 1982bf57db7f8f8d172c5c43618cb3aecc671205
Author: Kang <kx...@gmail.com>
AuthorDate: Wed Feb 7 21:48:58 2024 +0800
[fix](index) disable OR predicate for bitmap index (#30971)
---
be/src/olap/rowset/segment_v2/segment_iterator.cpp | 22 ++--------------------
be/src/olap/rowset/segment_v2/segment_iterator.h | 3 ---
2 files changed, 2 insertions(+), 23 deletions(-)
diff --git a/be/src/olap/rowset/segment_v2/segment_iterator.cpp b/be/src/olap/rowset/segment_v2/segment_iterator.cpp
index ee81f29c363..10293d2aeb7 100644
--- a/be/src/olap/rowset/segment_v2/segment_iterator.cpp
+++ b/be/src/olap/rowset/segment_v2/segment_iterator.cpp
@@ -750,7 +750,7 @@ bool SegmentIterator::_can_filter_by_preds_except_leafnode_of_andnode() {
}
for (auto pred : _col_preds_except_leafnode_of_andnode) {
if (_not_apply_index_pred.count(pred->column_id()) ||
- (!_check_apply_by_bitmap_index(pred) && !_check_apply_by_inverted_index(pred, true))) {
+ (!_check_apply_by_inverted_index(pred, true))) {
return false;
}
// all predicates are evaluated by index, then true, else false
@@ -762,14 +762,6 @@ bool SegmentIterator::_can_filter_by_preds_except_leafnode_of_andnode() {
return true;
}
-bool SegmentIterator::_check_apply_by_bitmap_index(ColumnPredicate* pred) {
- if (_bitmap_index_iterators[pred->column_id()] == nullptr) {
- // no bitmap index for this column
- return false;
- }
- return true;
-}
-
bool SegmentIterator::_check_apply_by_inverted_index(ColumnPredicate* pred, bool pred_in_compound) {
if (_opts.runtime_state && !_opts.runtime_state->query_options().enable_inverted_index_query) {
return false;
@@ -809,13 +801,6 @@ bool SegmentIterator::_check_apply_by_inverted_index(ColumnPredicate* pred, bool
return true;
}
-Status SegmentIterator::_apply_bitmap_index_except_leafnode_of_andnode(
- ColumnPredicate* pred, roaring::Roaring* output_result) {
- RETURN_IF_ERROR(pred->evaluate(_bitmap_index_iterators[pred->column_id()].get(),
- _segment->num_rows(), output_result));
- return Status::OK();
-}
-
Status SegmentIterator::_apply_inverted_index_except_leafnode_of_andnode(
ColumnPredicate* pred, roaring::Roaring* output_result) {
RETURN_IF_ERROR(pred->evaluate(*_schema, _inverted_index_iterators[pred->column_id()].get(),
@@ -834,13 +819,10 @@ Status SegmentIterator::_apply_index_except_leafnode_of_andnode() {
continue;
}
- bool can_apply_by_bitmap_index = _check_apply_by_bitmap_index(pred);
bool can_apply_by_inverted_index = _check_apply_by_inverted_index(pred, true);
roaring::Roaring bitmap = _row_bitmap;
Status res = Status::OK();
- if (can_apply_by_bitmap_index) {
- res = _apply_bitmap_index_except_leafnode_of_andnode(pred, &bitmap);
- } else if (can_apply_by_inverted_index) {
+ if (can_apply_by_inverted_index) {
res = _apply_inverted_index_except_leafnode_of_andnode(pred, &bitmap);
} else {
continue;
diff --git a/be/src/olap/rowset/segment_v2/segment_iterator.h b/be/src/olap/rowset/segment_v2/segment_iterator.h
index 375747907fb..a282712da3c 100644
--- a/be/src/olap/rowset/segment_v2/segment_iterator.h
+++ b/be/src/olap/rowset/segment_v2/segment_iterator.h
@@ -183,8 +183,6 @@ private:
std::set<const ColumnPredicate*>& no_need_to_pass_column_predicate_set,
bool* continue_apply);
[[nodiscard]] Status _apply_index_except_leafnode_of_andnode();
- [[nodiscard]] Status _apply_bitmap_index_except_leafnode_of_andnode(
- ColumnPredicate* pred, roaring::Roaring* output_result);
[[nodiscard]] Status _apply_inverted_index_except_leafnode_of_andnode(
ColumnPredicate* pred, roaring::Roaring* output_result);
bool _column_has_fulltext_index(int32_t cid);
@@ -251,7 +249,6 @@ private:
void _convert_dict_code_for_predicate_if_necessary_impl(ColumnPredicate* predicate);
- bool _check_apply_by_bitmap_index(ColumnPredicate* pred);
bool _check_apply_by_inverted_index(ColumnPredicate* pred, bool pred_in_compound = false);
std::string _gen_predicate_result_sign(ColumnPredicate* predicate);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org