Do not report ERROR when sample rate equals 100

This commit is contained in:
ZenoWang
2024-02-06 14:49:31 +00:00
committed by ob-robot
parent 1f1d5c08ae
commit c8ef409bf3
3710 changed files with 486984 additions and 3083329 deletions

View File

@ -161,8 +161,6 @@ int ObLogDistinct::do_re_est_cost(EstimateCostInfo &param, double &card, double
double child_cost = child->get_cost();
double child_ndv = total_ndv_;
const int64_t parallel = param.need_parallel_;
double origin_child_card = child_card;
bool need_scale_ndv = false;
if (param.need_row_count_ >= 0 &&
child_card > 0 &&
total_ndv_ > 0 &&
@ -172,13 +170,9 @@ int ObLogDistinct::do_re_est_cost(EstimateCostInfo &param, double &card, double
param.need_row_count_ = child_card * (1 - std::pow((1 - child_ndv / total_ndv_), total_ndv_ / child_card));
} else {
param.need_row_count_ = -1;
need_scale_ndv = true;
}
if (OB_FAIL(SMART_CALL(child->re_est_cost(param, child_card, child_cost)))) {
LOG_WARN("failed to re est child cost", K(ret));
} else if (need_scale_ndv &&
FALSE_IT(child_ndv = std::min(child_ndv, ObOptSelectivity::scale_distinct(child_card, origin_child_card, child_ndv)))) {
// do nothing
} else if (OB_FAIL(inner_est_cost(parallel, child_card, child_ndv, op_cost))) {
LOG_WARN("failed to est distinct cost", K(ret));
} else {
@ -223,13 +217,13 @@ int ObLogDistinct::inner_est_cost(const int64_t parallel, double child_card, dou
per_dop_ndv,
child->get_width(),
distinct_exprs_,
opt_ctx);
opt_ctx.get_cost_model_type());
} else {
op_cost = ObOptEstCost::cost_hash_distinct(per_dop_card,
per_dop_ndv,
child->get_width(),
distinct_exprs_,
opt_ctx);
opt_ctx.get_cost_model_type());
}
}
return ret;