[CP] fix sysbench newsort degradation

This commit is contained in:
obdev
2023-04-13 07:08:08 +00:00
committed by ob-robot
parent eaeca23f8e
commit 7e1194920a
7 changed files with 61 additions and 41 deletions

View File

@ -8088,7 +8088,8 @@ int ObOptimizerUtil::get_minset_of_exprs(const ObIArray<ObRawExpr *> &src_exprs,
int ObOptimizerUtil::check_can_encode_sortkey(const common::ObIArray<OrderItem> &order_keys,
bool &can_sort_opt,
ObLogPlan& plan)
ObLogPlan& plan,
double card)
{
int ret = OB_SUCCESS;
ObSEArray<ObRawExpr *, 4> sort_keys;
@ -8126,9 +8127,19 @@ int ObOptimizerUtil::check_can_encode_sortkey(const common::ObIArray<OrderItem>
LOG_WARN("failed to estimate width for output join column exprs", K(ret));
} else if (avg_len > 256) {
can_sort_opt = false;
} else if (avg_len < 64 && card < 100000) {
can_sort_opt = false;
} else if (avg_len > 64 && avg_len < 128 && card < 1500000 ) {
can_sort_opt = false;
} else {
// do nothing
}
int tmp_ret = OB_SUCCESS;
tmp_ret = OB_E(EventTable::EN_ENABLE_NEWSORT_FORCE) OB_SUCCESS;
if (OB_SUCCESS != tmp_ret) {
can_sort_opt = true;
}
}
return ret;
}