Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix](inverted index) fix need read data optimize problem #28104

Merged
merged 1 commit into from
Dec 7, 2023
Merged
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
16 changes: 13 additions & 3 deletions be/src/olap/rowset/segment_v2/segment_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,7 @@ Status SegmentIterator::_apply_index_except_leafnode_of_andnode() {
if (_downgrade_without_index(res, need_remaining_after_evaluate)) {
// downgrade without index query
_not_apply_index_pred.insert(pred->column_id());
_need_read_data_indices[pred->column_id()] = true;
continue;
}
LOG(WARNING) << "failed to evaluate index"
Expand All @@ -886,7 +887,10 @@ Status SegmentIterator::_apply_index_except_leafnode_of_andnode() {
_check_column_pred_all_push_down(column_name, true,
pred->type() == PredicateType::MATCH) &&
!pred->predicate_params()->marked_by_runtime_filter) {
_need_read_data_indices[pred->column_id()] = false;
// if column's need_read_data already set true, we can not set it to false now.
if (_need_read_data_indices.find(pred->column_id()) == _need_read_data_indices.end()) {
_need_read_data_indices[pred->column_id()] = false;
}
}
}

Expand Down Expand Up @@ -973,6 +977,7 @@ Status SegmentIterator::_apply_inverted_index_on_column_predicate(
if (!res.ok()) {
if (_downgrade_without_index(res, need_remaining_after_evaluate)) {
remaining_predicates.emplace_back(pred);
_need_read_data_indices[pred->column_id()] = true;
return Status::OK();
}
LOG(WARNING) << "failed to evaluate index"
Expand Down Expand Up @@ -1003,7 +1008,10 @@ Status SegmentIterator::_apply_inverted_index_on_column_predicate(
if (_check_column_pred_all_push_down(column_name, false,
pred->type() == PredicateType::MATCH) &&
!pred->predicate_params()->marked_by_runtime_filter) {
_need_read_data_indices[pred->column_id()] = false;
// if column's need_read_data already set true, we can not set it to false now.
if (_need_read_data_indices.find(pred->column_id()) == _need_read_data_indices.end()) {
_need_read_data_indices[pred->column_id()] = false;
}
}
}
return Status::OK();
Expand Down Expand Up @@ -1035,7 +1043,9 @@ Status SegmentIterator::_apply_inverted_index_on_block_column_predicate(
if (res.ok()) {
if (_check_column_pred_all_push_down(column_name) &&
!all_predicates_are_marked_by_runtime_filter(predicate_set)) {
_need_read_data_indices[column_id] = false;
if (_need_read_data_indices.find(column_id) == _need_read_data_indices.end()) {
_need_read_data_indices[column_id] = false;
}
}
no_need_to_pass_column_predicate_set.insert(predicate_set.begin(), predicate_set.end());
_row_bitmap &= output_result;
Expand Down