[FEAT MERGE] support auto dop

This commit is contained in:
obdev
2023-04-28 15:11:52 +00:00
committed by ob-robot
parent 642f1c7d84
commit b41dc0ebdd
106 changed files with 3815 additions and 2844 deletions

View File

@ -73,7 +73,7 @@ int ObLogCount::est_width()
}
int ObLogCount::re_est_cost(EstimateCostInfo &param, double &card, double &cost)
int ObLogCount::do_re_est_cost(EstimateCostInfo &param, double &card, double &op_cost, double &cost)
{
int ret = OB_SUCCESS;
double sel = 1.0;
@ -91,8 +91,7 @@ int ObLogCount::re_est_cost(EstimateCostInfo &param, double &card, double &cost)
} else {
double child_card = child->get_card();
double child_cost = child->get_cost();
double op_cost = 0.0;
if (param.need_row_count_ >= 0 && param.need_row_count_ <= get_card()) {
if (param.need_row_count_ >= 0 && param.need_row_count_ < get_card()) {
//child need row count
if (sel > OB_DOUBLE_EPSINON) {
param.need_row_count_ /= sel;
@ -105,11 +104,6 @@ int ObLogCount::re_est_cost(EstimateCostInfo &param, double &card, double &cost)
} else {
cost = op_cost + child_cost;
card = child_card * sel;
if (param.override_) {
set_op_cost(op_cost);
set_cost(cost);
set_card(card);
}
}
}
return ret;