Skip to content

Commit

Permalink
[fix](profile) Short-circuit and del predicate filter rows are not co…
Browse files Browse the repository at this point in the history
…unted on vectorized exec (apache#9268)
  • Loading branch information
zenoyang authored Apr 29, 2022
1 parent cbfb4a3 commit 2fa1911
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
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;

// 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

0 comments on commit 2fa1911

Please sign in to comment.