Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 2 additions & 20 deletions be/src/olap/rowset/segment_v2/segment_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,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
Expand All @@ -811,14 +811,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;
Expand Down Expand Up @@ -860,13 +852,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(_storage_name_and_type[pred->column_id()],
Expand All @@ -886,13 +871,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;
Expand Down
3 changes: 0 additions & 3 deletions be/src/olap/rowset/segment_v2/segment_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ class SegmentIterator : public RowwiseIterator {
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);
Expand Down Expand Up @@ -286,7 +284,6 @@ class SegmentIterator : public RowwiseIterator {

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);
Expand Down