[CP] support virtual table and core table gather stats and use stats

This commit is contained in:
wangt1xiuyi
2023-03-03 03:40:59 +00:00
committed by ob-robot
parent d91c405414
commit 170ebd9ba9
18 changed files with 492 additions and 137 deletions

View File

@ -1164,7 +1164,9 @@ int ObOptEstCostModel::cost_table(ObCostTableScanInfo &est_cost_info,
double &index_back_cost)
{
int ret = OB_SUCCESS;
if (is_virtual_table(est_cost_info.ref_table_id_)) {
if (is_virtual_table(est_cost_info.ref_table_id_) &&
(est_cost_info.row_est_method_ == RowCountEstMethod::INVALID_METHOD ||
est_cost_info.row_est_method_ == RowCountEstMethod::DEFAULT_STAT)) {
if (OB_FAIL(cost_virtual_table(est_cost_info, cost))) {
LOG_WARN("failed to estimate virtual table cost", K(ret));
} else {