[FEAT MERGE]adaptive cost model

This commit is contained in:
zzg19950727
2024-02-07 11:01:37 +00:00
committed by ob-robot
parent 1ee1ad37e4
commit 9a22f3ea88
85 changed files with 21899 additions and 18832 deletions

View File

@ -2534,7 +2534,7 @@ int ObSelectLogPlan::allocate_set_distinct_as_top(ObLogicalOperator *&top)
top->get_card(),
top->get_width(),
distinct_exprs,
get_optimizer_context().get_cost_model_type());
get_optimizer_context());
distinct->set_cost(top->get_cost() + distinct_cost);
distinct->set_op_cost(distinct_cost);
top = distinct_op;
@ -3461,7 +3461,7 @@ int ObSelectLogPlan::get_minimal_cost_set_plan(const int64_t in_parallel,
right_need_sort,
right_prefix_pos,
right_path_cost,
get_optimizer_context().get_cost_model_type()))) {
get_optimizer_context()))) {
LOG_WARN("failed to compute cost for merge join style op", K(ret));
} else if (NULL == best_plan || right_path_cost < best_cost) {
if (OB_FAIL(best_order_items.assign(right_order_items))) {
@ -7077,7 +7077,7 @@ int ObSelectLogPlan::generate_late_materialization_table_get(ObLogTableScan *ind
// set card and cost
table_scan->set_card(1.0);
table_scan->set_op_cost(ObOptEstCost::cost_late_materialization_table_get(stmt->get_column_size(),
get_optimizer_context().get_cost_model_type()));
get_optimizer_context()));
table_scan->set_cost(table_scan->get_op_cost());
est_cost_info->output_row_count_ = 1.0;
est_cost_info->phy_query_range_row_count_ = 1.0;
@ -7183,7 +7183,7 @@ int ObSelectLogPlan::allocate_late_materialization_join_as_top(ObLogicalOperator
right_child->get_cost(),
join->get_op_cost(),
join->get_cost(),
get_optimizer_context().get_cost_model_type());
get_optimizer_context());
if (OB_FAIL(join->set_op_ordering(left_child->get_op_ordering()))) {
LOG_WARN("failed to set op ordering", K(ret));
} else {
@ -7254,7 +7254,7 @@ int ObSelectLogPlan::if_plan_need_late_materialization(ObLogicalOperator *top,
if (OB_FAIL(ObOptEstCost::cost_table(*table_scan->get_est_cost_info(),
table_scan->get_parallel(),
op_cost,
get_optimizer_context().get_cost_model_type()))) {
get_optimizer_context()))) {
LOG_WARN("failed to get index access info", K(ret));
} else if (OB_FAIL(child_sort->est_cost())) {
LOG_WARN("failed to compute property", K(ret));
@ -7265,7 +7265,7 @@ int ObSelectLogPlan::if_plan_need_late_materialization(ObLogicalOperator *top,
top->get_cost(),
stmt->get_column_size(),
late_mater_cost,
get_optimizer_context().get_cost_model_type());
get_optimizer_context());
table_scan->set_cost(op_cost);
table_scan->set_op_cost(op_cost);
index_scan = table_scan;