Give expected_task_load and esti_table_size correct default values when encounter too small tablet size in nlj&spf

This commit is contained in:
obdev 2024-10-08 20:45:55 +00:00 committed by ob-robot
parent d22b2f7f2e
commit 7c655f1ea0

View File

@ -10089,11 +10089,12 @@ int ObOptimizerUtil::compute_nlj_spf_storage_compute_parallel_skew(ObOptimizerCo
} else {
ObParallelBlockRangeTaskParams params;
params.parallelism_ = compute_parallel;
params.expected_task_load_ = table_schema->get_tablet_size() / 1024 / 1024;
params.expected_task_load_ = table_schema->get_tablet_size() / 1024 / 1024 <= 0 ? sql::OB_EXPECTED_TASK_LOAD : table_schema->get_tablet_size() / 1024 / 1024;
//convert from B -> MB
int64_t esti_table_size = (esti_table_meta_info->micro_block_count_ * esti_table_meta_info->micro_block_size_) / 1024 / 1024;
double query_range_filter_ratio = esti_table_meta_info->row_count_ / esti_table_meta_info->table_row_count_;
esti_table_size *= query_range_filter_ratio;
esti_table_size = MAX(0, esti_table_size);
int64_t esti_task_cnt_by_data_size = 0;
if (OB_FAIL(ObGranuleUtil::compute_total_task_count(params, esti_table_size,
esti_task_cnt_by_data_size))) {