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](profile) Short-circuit and del predicate filter rows are not counted on vectorized exec #9268

Merged
merged 1 commit into from
Apr 29, 2022
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
[fix](profile) Short-circuit and del predicate filter rows are not co…
…unted on vectorized exec
  • Loading branch information
zenoyang committed Apr 27, 2022
commit 53a0368c054691f93170ceadc676b34728535224
2 changes: 1 addition & 1 deletion be/src/olap/olap_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class Field;
class WrapperField;
using KeyRange = std::pair<WrapperField*, WrapperField*>;

static const int GENERAL_DEBUG_COUNT = 4;
static const int GENERAL_DEBUG_COUNT = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change it to 0?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

general_debug_ns is used for debugging, by default, there is no place to call it. Therefore, GENERAL_DEBUG_COUNT is set to 0, reducing unnecessary overhead.
When developers need to debug, they can change it according to their own needs.


// ReaderStatistics used to collect statistics when scan data from storage
struct OlapReaderStatistics {
Expand Down
4 changes: 4 additions & 0 deletions be/src/olap/rowset/segment_v2/segment_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,7 @@ void SegmentIterator::_evaluate_short_circuit_predicate(uint16_t* vec_sel_rowid_
return;
}

uint16_t original_size = *selected_size_ptr;
for (auto predicate : _short_cir_eval_predicate) {
auto column_id = predicate->column_id();
auto& short_cir_column = _current_return_columns[column_id];
Expand All @@ -875,10 +876,13 @@ void SegmentIterator::_evaluate_short_circuit_predicate(uint16_t* vec_sel_rowid_
predicate->set_dict_code_if_necessary(*short_cir_column);
predicate->evaluate(*short_cir_column, vec_sel_rowid_idx, selected_size_ptr);
}
_opts.stats->rows_vec_cond_filtered += original_size - *selected_size_ptr;

// evaluate delete condition
original_size = *selected_size_ptr;
_opts.delete_condition_predicates->evaluate(_current_return_columns, vec_sel_rowid_idx,
selected_size_ptr);
_opts.stats->rows_vec_del_cond_filtered += original_size - *selected_size_ptr;
}

void SegmentIterator::_read_columns_by_rowids(std::vector<ColumnId>& read_column_ids,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Commit is divided into ‘ title ’ and ‘ content ’ , the title should be l
* style: Code style adjustment
* typo: Code or Document correction
* refactor: Code refactoring (no function changes involved)
* performance: Performance optimization
* performance/optimize: Performance optimization
* test: Addition or repair of unit test
* chore: Modification of build tool
* revert: Revert a previous commit
Expand Down Expand Up @@ -78,7 +78,9 @@ Commit is divided into ‘ title ’ and ‘ content ’ , the title should be l
* log
* cache
* config
* vectorization
* docs
* profile

Some tips:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ Commit 分为“标题”和“内容”。原则上标题全部小写。内容
* config
* vectorization
* docs
* profile

几点说明:

Expand Down