enhance plan expiration, optimize index prune for small row count

This commit is contained in:
zs0
2021-11-11 19:49:35 +08:00
committed by LINxiansheng
parent f2f2aed95c
commit c84b7de59c
17 changed files with 488 additions and 259 deletions

View File

@ -1227,6 +1227,36 @@ int ObLogTableScan::explain_index_selection_info(char* buf, int64_t& buf_len, in
} else { /* Do nothing */
}
}
// print unstable index name
if (OB_SUCC(ret) && table_opt_info_->unstable_index_name_.count() > 0) {
if (OB_FAIL(BUF_PRINTF(", "))) {
LOG_WARN("BUF_PRINTF fails", K(ret));
} else if (OB_FAIL(BUF_PRINTF("unstable_index_name["))) {
LOG_WARN("BUF_PRINTF fails", K(ret));
} else {
for (int64_t i = 0; OB_SUCC(ret) && i < table_opt_info_->unstable_index_name_.count(); ++i) {
if (OB_FAIL(BUF_PRINTF("%.*s",
table_opt_info_->unstable_index_name_.at(i).length(),
table_opt_info_->unstable_index_name_.at(i).ptr()))) {
LOG_WARN("BUF_PRINTF fails", K(ret));
} else if (i != table_opt_info_->unstable_index_name_.count() - 1) {
if (OB_FAIL(BUF_PRINTF(","))) {
LOG_WARN("BUF_PRINTF fails", K(ret));
} else { /* do nothing*/
}
} else { /* do nothing*/
}
}
}
if (OB_SUCC(ret)) {
if (OB_FAIL(BUF_PRINTF("]"))) {
LOG_WARN("BUF_PRINTF fails", K(ret));
} else { /* Do nothing */
}
} else { /* Do nothing */
}
}
// print est row count infos
if (OB_SUCC(ret) && est_records_.count() > 0) {
if (OB_FAIL(BUF_PRINTF(", estimation info[table_id:%ld,", est_records_.at(0).table_id_))) {