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

[Chore](profile) add RowsExprPredFiltered RowsExprPredInput on profile #47182

Merged
merged 1 commit into from
Jan 22, 2025
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
2 changes: 2 additions & 0 deletions be/src/olap/olap_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,10 @@ struct OlapReaderStatistics {

int64_t rows_vec_cond_filtered = 0;
int64_t rows_short_circuit_cond_filtered = 0;
int64_t rows_expr_cond_filtered = 0;
int64_t vec_cond_input_rows = 0;
int64_t short_circuit_cond_input_rows = 0;
int64_t expr_cond_input_rows = 0;
int64_t rows_vec_del_cond_filtered = 0;
int64_t vec_cond_ns = 0;
int64_t short_cond_ns = 0;
Expand Down
2 changes: 2 additions & 0 deletions be/src/olap/rowset/segment_v2/segment_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2299,12 +2299,14 @@ Status SegmentIterator::_execute_common_expr(uint16_t* sel_rowid_idx, uint16_t&
DCHECK(!_remaining_conjunct_roots.empty());
DCHECK(block->rows() != 0);
size_t prev_columns = block->columns();
_opts.stats->expr_cond_input_rows += selected_size;

vectorized::IColumn::Filter filter;
RETURN_IF_ERROR(vectorized::VExprContext::execute_conjuncts_and_filter_block(
_common_expr_ctxs_push_down, block, _columns_to_filter, prev_columns, filter));

selected_size = _evaluate_common_expr_filter(sel_rowid_idx, selected_size, filter);
_opts.stats->rows_expr_cond_filtered += selected_size;
return Status::OK();
}

Expand Down
3 changes: 3 additions & 0 deletions be/src/pipeline/exec/olap_scan_operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,13 @@ Status OlapScanLocalState::_init_profile() {
ADD_COUNTER(_segment_profile, "RowsVectorPredFiltered", TUnit::UNIT);
_rows_short_circuit_cond_filtered_counter =
ADD_COUNTER(_segment_profile, "RowsShortCircuitPredFiltered", TUnit::UNIT);
_rows_expr_cond_filtered_counter =
ADD_COUNTER(_segment_profile, "RowsExprPredFiltered", TUnit::UNIT);
_rows_vec_cond_input_counter =
ADD_COUNTER(_segment_profile, "RowsVectorPredInput", TUnit::UNIT);
_rows_short_circuit_cond_input_counter =
ADD_COUNTER(_segment_profile, "RowsShortCircuitPredInput", TUnit::UNIT);
_rows_expr_cond_input_counter = ADD_COUNTER(_segment_profile, "RowsExprPredInput", TUnit::UNIT);
_vec_cond_timer = ADD_TIMER(_segment_profile, "VectorPredEvalTime");
_short_cond_timer = ADD_TIMER(_segment_profile, "ShortPredEvalTime");
_expr_filter_timer = ADD_TIMER(_segment_profile, "ExprFilterEvalTime");
Expand Down
2 changes: 2 additions & 0 deletions be/src/pipeline/exec/olap_scan_operator.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ class OlapScanLocalState final : public ScanLocalState<OlapScanLocalState> {

RuntimeProfile::Counter* _rows_vec_cond_filtered_counter = nullptr;
RuntimeProfile::Counter* _rows_short_circuit_cond_filtered_counter = nullptr;
RuntimeProfile::Counter* _rows_expr_cond_filtered_counter = nullptr;
RuntimeProfile::Counter* _rows_vec_cond_input_counter = nullptr;
RuntimeProfile::Counter* _rows_short_circuit_cond_input_counter = nullptr;
RuntimeProfile::Counter* _rows_expr_cond_input_counter = nullptr;
RuntimeProfile::Counter* _vec_cond_timer = nullptr;
RuntimeProfile::Counter* _short_cond_timer = nullptr;
RuntimeProfile::Counter* _expr_filter_timer = nullptr;
Expand Down
4 changes: 3 additions & 1 deletion be/src/vec/exec/scan/new_olap_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,12 @@ void NewOlapScanner::_collect_profile_before_close() {
COUNTER_UPDATE(local_state->_rows_vec_cond_filtered_counter, stats.rows_vec_cond_filtered);
COUNTER_UPDATE(local_state->_rows_short_circuit_cond_filtered_counter,
stats.rows_short_circuit_cond_filtered);
COUNTER_UPDATE(local_state->_rows_expr_cond_filtered_counter, stats.rows_expr_cond_filtered);
COUNTER_UPDATE(local_state->_rows_vec_cond_input_counter, stats.vec_cond_input_rows);
COUNTER_UPDATE(local_state->_rows_short_circuit_cond_input_counter,
stats.short_circuit_cond_input_rows);
for (auto& [id, info] : stats.filter_info) {
COUNTER_UPDATE(local_state->_rows_expr_cond_input_counter, stats.expr_cond_input_rows);
for (const auto& [id, info] : stats.filter_info) {
local_state->add_filter_info(id, info);
}
COUNTER_UPDATE(local_state->_stats_filtered_counter, stats.rows_stats_filtered);
Expand Down
Loading