[FEAT MERGE] [CP] Improve the rowcount estimation

Co-authored-by: akaError <lzg020616@163.com>
This commit is contained in:
xianyu-w
2024-02-09 19:58:18 +00:00
committed by ob-robot
parent da232dc640
commit dc32079645
70 changed files with 5953 additions and 3722 deletions

View File

@ -198,10 +198,12 @@ int ObOptEstUtils::if_expr_start_with_patten_sign(const ParamStore *params,
const ObRawExpr *esp_expr,
ObExecContext *exec_ctx,
ObIAllocator &allocator,
bool &is_start_with)
bool &is_start_with,
bool &all_is_percent_sign)
{
int ret = OB_SUCCESS;
is_start_with = false;
all_is_percent_sign = false;
bool get_value = false;
bool empty_escape = false;
char escape;
@ -234,6 +236,15 @@ int ObOptEstUtils::if_expr_start_with_patten_sign(const ParamStore *params,
}
} else { /* do nothing */ }
}
if (OB_SUCC(ret) && is_start_with) {
all_is_percent_sign = true;
const ObString &expr_str = value.get_string();
for (int64_t i = 0; all_is_percent_sign && i < expr_str.length(); i++) {
if (expr_str[i] != '%') {
all_is_percent_sign = false;
}
}
}
return ret;
}