This is an automated email from the ASF dual-hosted git repository. gabriellee pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new 0cf7e74939b [refactor](scanner) Delete meaning-less macro (#43555) 0cf7e74939b is described below commit 0cf7e74939bf430deb16521cc5b55e10a28e13fc Author: Gabriel <gabrielleeb...@gmail.com> AuthorDate: Mon Nov 11 14:21:42 2024 +0800 [refactor](scanner) Delete meaning-less macro (#43555) Delete meaning-less macro --- be/src/vec/exec/scan/new_olap_scanner.cpp | 179 ++++++++++++++---------------- 1 file changed, 86 insertions(+), 93 deletions(-) diff --git a/be/src/vec/exec/scan/new_olap_scanner.cpp b/be/src/vec/exec/scan/new_olap_scanner.cpp index f40f30f5b16..4c0b30e440e 100644 --- a/be/src/vec/exec/scan/new_olap_scanner.cpp +++ b/be/src/vec/exec/scan/new_olap_scanner.cpp @@ -558,104 +558,97 @@ void NewOlapScanner::_collect_profile_before_close() { VScanner::_collect_profile_before_close(); -#ifndef INCR_COUNTER -#define INCR_COUNTER(Parent) \ - COUNTER_UPDATE(Parent->_io_timer, stats.io_ns); \ - COUNTER_UPDATE(Parent->_read_compressed_counter, stats.compressed_bytes_read); \ - COUNTER_UPDATE(Parent->_scan_bytes, stats.compressed_bytes_read); \ - COUNTER_UPDATE(Parent->_decompressor_timer, stats.decompress_ns); \ - COUNTER_UPDATE(Parent->_read_uncompressed_counter, stats.uncompressed_bytes_read); \ - COUNTER_UPDATE(Parent->_block_load_timer, stats.block_load_ns); \ - COUNTER_UPDATE(Parent->_block_load_counter, stats.blocks_load); \ - COUNTER_UPDATE(Parent->_block_fetch_timer, stats.block_fetch_ns); \ - COUNTER_UPDATE(Parent->_delete_bitmap_get_agg_timer, stats.delete_bitmap_get_agg_ns); \ - COUNTER_UPDATE(Parent->_scan_rows, stats.raw_rows_read); \ - COUNTER_UPDATE(Parent->_vec_cond_timer, stats.vec_cond_ns); \ - COUNTER_UPDATE(Parent->_short_cond_timer, stats.short_cond_ns); \ - COUNTER_UPDATE(Parent->_expr_filter_timer, stats.expr_filter_ns); \ - COUNTER_UPDATE(Parent->_block_init_timer, stats.block_init_ns); \ - COUNTER_UPDATE(Parent->_block_init_seek_timer, stats.block_init_seek_ns); \ - COUNTER_UPDATE(Parent->_block_init_seek_counter, stats.block_init_seek_num); \ - COUNTER_UPDATE(Parent->_segment_generate_row_range_timer, stats.generate_row_ranges_ns); \ - COUNTER_UPDATE(Parent->_segment_generate_row_range_by_bf_timer, \ - stats.generate_row_ranges_by_bf_ns); \ - COUNTER_UPDATE(Parent->_collect_iterator_merge_next_timer, \ - stats.collect_iterator_merge_next_timer); \ - COUNTER_UPDATE(Parent->_segment_generate_row_range_by_zonemap_timer, \ - stats.generate_row_ranges_by_zonemap_ns); \ - COUNTER_UPDATE(Parent->_segment_generate_row_range_by_dict_timer, \ - stats.generate_row_ranges_by_dict_ns); \ - COUNTER_UPDATE(Parent->_predicate_column_read_timer, stats.predicate_column_read_ns); \ - COUNTER_UPDATE(Parent->_non_predicate_column_read_timer, stats.non_predicate_read_ns); \ - COUNTER_UPDATE(Parent->_predicate_column_read_seek_timer, \ - stats.predicate_column_read_seek_ns); \ - COUNTER_UPDATE(Parent->_predicate_column_read_seek_counter, \ - stats.predicate_column_read_seek_num); \ - COUNTER_UPDATE(Parent->_lazy_read_timer, stats.lazy_read_ns); \ - COUNTER_UPDATE(Parent->_lazy_read_seek_timer, stats.block_lazy_read_seek_ns); \ - COUNTER_UPDATE(Parent->_lazy_read_seek_counter, stats.block_lazy_read_seek_num); \ - COUNTER_UPDATE(Parent->_output_col_timer, stats.output_col_ns); \ - COUNTER_UPDATE(Parent->_rows_vec_cond_filtered_counter, stats.rows_vec_cond_filtered); \ - COUNTER_UPDATE(Parent->_rows_short_circuit_cond_filtered_counter, \ - stats.rows_short_circuit_cond_filtered); \ - COUNTER_UPDATE(Parent->_rows_vec_cond_input_counter, stats.vec_cond_input_rows); \ - COUNTER_UPDATE(Parent->_rows_short_circuit_cond_input_counter, \ - stats.short_circuit_cond_input_rows); \ - for (auto& [id, info] : stats.filter_info) { \ - Parent->add_filter_info(id, info); \ - } \ - COUNTER_UPDATE(Parent->_stats_filtered_counter, stats.rows_stats_filtered); \ - COUNTER_UPDATE(Parent->_stats_rp_filtered_counter, stats.rows_stats_rp_filtered); \ - COUNTER_UPDATE(Parent->_dict_filtered_counter, stats.rows_dict_filtered); \ - COUNTER_UPDATE(Parent->_bf_filtered_counter, stats.rows_bf_filtered); \ - COUNTER_UPDATE(Parent->_del_filtered_counter, stats.rows_del_filtered); \ - COUNTER_UPDATE(Parent->_del_filtered_counter, stats.rows_del_by_bitmap); \ - COUNTER_UPDATE(Parent->_del_filtered_counter, stats.rows_vec_del_cond_filtered); \ - COUNTER_UPDATE(Parent->_conditions_filtered_counter, stats.rows_conditions_filtered); \ - COUNTER_UPDATE(Parent->_key_range_filtered_counter, stats.rows_key_range_filtered); \ - COUNTER_UPDATE(Parent->_total_pages_num_counter, stats.total_pages_num); \ - COUNTER_UPDATE(Parent->_cached_pages_num_counter, stats.cached_pages_num); \ - COUNTER_UPDATE(Parent->_bitmap_index_filter_counter, stats.rows_bitmap_index_filtered); \ - COUNTER_UPDATE(Parent->_bitmap_index_filter_timer, stats.bitmap_index_filter_timer); \ - COUNTER_UPDATE(Parent->_inverted_index_filter_counter, stats.rows_inverted_index_filtered); \ - COUNTER_UPDATE(Parent->_inverted_index_filter_timer, stats.inverted_index_filter_timer); \ - COUNTER_UPDATE(Parent->_inverted_index_query_cache_hit_counter, \ - stats.inverted_index_query_cache_hit); \ - COUNTER_UPDATE(Parent->_inverted_index_query_cache_miss_counter, \ - stats.inverted_index_query_cache_miss); \ - COUNTER_UPDATE(Parent->_inverted_index_query_timer, stats.inverted_index_query_timer); \ - COUNTER_UPDATE(Parent->_inverted_index_query_null_bitmap_timer, \ - stats.inverted_index_query_null_bitmap_timer); \ - COUNTER_UPDATE(Parent->_inverted_index_query_bitmap_copy_timer, \ - stats.inverted_index_query_bitmap_copy_timer); \ - COUNTER_UPDATE(Parent->_inverted_index_searcher_open_timer, \ - stats.inverted_index_searcher_open_timer); \ - COUNTER_UPDATE(Parent->_inverted_index_searcher_search_timer, \ - stats.inverted_index_searcher_search_timer); \ - COUNTER_UPDATE(Parent->_inverted_index_searcher_cache_hit_counter, \ - stats.inverted_index_searcher_cache_hit); \ - COUNTER_UPDATE(Parent->_inverted_index_searcher_cache_miss_counter, \ - stats.inverted_index_searcher_cache_miss); \ - COUNTER_UPDATE(Parent->_inverted_index_downgrade_count_counter, \ - stats.inverted_index_downgrade_count); \ - if (config::enable_file_cache) { \ - io::FileCacheProfileReporter cache_profile(Parent->_segment_profile.get()); \ - cache_profile.update(&stats.file_cache_stats); \ - } \ - COUNTER_UPDATE(Parent->_output_index_result_column_timer, \ - stats.output_index_result_column_timer); \ - COUNTER_UPDATE(Parent->_filtered_segment_counter, stats.filtered_segment_number); \ - COUNTER_UPDATE(Parent->_total_segment_counter, stats.total_segment_number); - // Update counters for NewOlapScanner // Update counters from tablet reader's stats auto& stats = _tablet_reader->stats(); - auto* local_state = (pipeline::OlapScanLocalState*)_local_state; - INCR_COUNTER(local_state); + COUNTER_UPDATE(local_state->_io_timer, stats.io_ns); + COUNTER_UPDATE(local_state->_read_compressed_counter, stats.compressed_bytes_read); + COUNTER_UPDATE(local_state->_scan_bytes, stats.compressed_bytes_read); + COUNTER_UPDATE(local_state->_decompressor_timer, stats.decompress_ns); + COUNTER_UPDATE(local_state->_read_uncompressed_counter, stats.uncompressed_bytes_read); + COUNTER_UPDATE(local_state->_block_load_timer, stats.block_load_ns); + COUNTER_UPDATE(local_state->_block_load_counter, stats.blocks_load); + COUNTER_UPDATE(local_state->_block_fetch_timer, stats.block_fetch_ns); + COUNTER_UPDATE(local_state->_delete_bitmap_get_agg_timer, stats.delete_bitmap_get_agg_ns); + COUNTER_UPDATE(local_state->_scan_rows, stats.raw_rows_read); + COUNTER_UPDATE(local_state->_vec_cond_timer, stats.vec_cond_ns); + COUNTER_UPDATE(local_state->_short_cond_timer, stats.short_cond_ns); + COUNTER_UPDATE(local_state->_expr_filter_timer, stats.expr_filter_ns); + COUNTER_UPDATE(local_state->_block_init_timer, stats.block_init_ns); + COUNTER_UPDATE(local_state->_block_init_seek_timer, stats.block_init_seek_ns); + COUNTER_UPDATE(local_state->_block_init_seek_counter, stats.block_init_seek_num); + COUNTER_UPDATE(local_state->_segment_generate_row_range_timer, stats.generate_row_ranges_ns); + COUNTER_UPDATE(local_state->_segment_generate_row_range_by_bf_timer, + stats.generate_row_ranges_by_bf_ns); + COUNTER_UPDATE(local_state->_collect_iterator_merge_next_timer, + stats.collect_iterator_merge_next_timer); + COUNTER_UPDATE(local_state->_segment_generate_row_range_by_zonemap_timer, + stats.generate_row_ranges_by_zonemap_ns); + COUNTER_UPDATE(local_state->_segment_generate_row_range_by_dict_timer, + stats.generate_row_ranges_by_dict_ns); + COUNTER_UPDATE(local_state->_predicate_column_read_timer, stats.predicate_column_read_ns); + COUNTER_UPDATE(local_state->_non_predicate_column_read_timer, stats.non_predicate_read_ns); + COUNTER_UPDATE(local_state->_predicate_column_read_seek_timer, + stats.predicate_column_read_seek_ns); + COUNTER_UPDATE(local_state->_predicate_column_read_seek_counter, + stats.predicate_column_read_seek_num); + COUNTER_UPDATE(local_state->_lazy_read_timer, stats.lazy_read_ns); + COUNTER_UPDATE(local_state->_lazy_read_seek_timer, stats.block_lazy_read_seek_ns); + COUNTER_UPDATE(local_state->_lazy_read_seek_counter, stats.block_lazy_read_seek_num); + COUNTER_UPDATE(local_state->_output_col_timer, stats.output_col_ns); + 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_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) { + local_state->add_filter_info(id, info); + } + COUNTER_UPDATE(local_state->_stats_filtered_counter, stats.rows_stats_filtered); + COUNTER_UPDATE(local_state->_stats_rp_filtered_counter, stats.rows_stats_rp_filtered); + COUNTER_UPDATE(local_state->_dict_filtered_counter, stats.rows_dict_filtered); + COUNTER_UPDATE(local_state->_bf_filtered_counter, stats.rows_bf_filtered); + COUNTER_UPDATE(local_state->_del_filtered_counter, stats.rows_del_filtered); + COUNTER_UPDATE(local_state->_del_filtered_counter, stats.rows_del_by_bitmap); + COUNTER_UPDATE(local_state->_del_filtered_counter, stats.rows_vec_del_cond_filtered); + COUNTER_UPDATE(local_state->_conditions_filtered_counter, stats.rows_conditions_filtered); + COUNTER_UPDATE(local_state->_key_range_filtered_counter, stats.rows_key_range_filtered); + COUNTER_UPDATE(local_state->_total_pages_num_counter, stats.total_pages_num); + COUNTER_UPDATE(local_state->_cached_pages_num_counter, stats.cached_pages_num); + COUNTER_UPDATE(local_state->_bitmap_index_filter_counter, stats.rows_bitmap_index_filtered); + COUNTER_UPDATE(local_state->_bitmap_index_filter_timer, stats.bitmap_index_filter_timer); + COUNTER_UPDATE(local_state->_inverted_index_filter_counter, stats.rows_inverted_index_filtered); + COUNTER_UPDATE(local_state->_inverted_index_filter_timer, stats.inverted_index_filter_timer); + COUNTER_UPDATE(local_state->_inverted_index_query_cache_hit_counter, + stats.inverted_index_query_cache_hit); + COUNTER_UPDATE(local_state->_inverted_index_query_cache_miss_counter, + stats.inverted_index_query_cache_miss); + COUNTER_UPDATE(local_state->_inverted_index_query_timer, stats.inverted_index_query_timer); + COUNTER_UPDATE(local_state->_inverted_index_query_null_bitmap_timer, + stats.inverted_index_query_null_bitmap_timer); + COUNTER_UPDATE(local_state->_inverted_index_query_bitmap_copy_timer, + stats.inverted_index_query_bitmap_copy_timer); + COUNTER_UPDATE(local_state->_inverted_index_searcher_open_timer, + stats.inverted_index_searcher_open_timer); + COUNTER_UPDATE(local_state->_inverted_index_searcher_search_timer, + stats.inverted_index_searcher_search_timer); + COUNTER_UPDATE(local_state->_inverted_index_searcher_cache_hit_counter, + stats.inverted_index_searcher_cache_hit); + COUNTER_UPDATE(local_state->_inverted_index_searcher_cache_miss_counter, + stats.inverted_index_searcher_cache_miss); + COUNTER_UPDATE(local_state->_inverted_index_downgrade_count_counter, + stats.inverted_index_downgrade_count); + if (config::enable_file_cache) { + io::FileCacheProfileReporter cache_profile(local_state->_segment_profile.get()); + cache_profile.update(&stats.file_cache_stats); + } + COUNTER_UPDATE(local_state->_output_index_result_column_timer, + stats.output_index_result_column_timer); + COUNTER_UPDATE(local_state->_filtered_segment_counter, stats.filtered_segment_number); + COUNTER_UPDATE(local_state->_total_segment_counter, stats.total_segment_number); -#undef INCR_COUNTER -#endif // Update metrics DorisMetrics::instance()->query_scan_bytes->increment( local_state->_read_compressed_counter->value()); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org