fix some optimizer stat bug

This commit is contained in:
wangt1xiuyi
2023-09-14 05:40:21 +00:00
committed by ob-robot
parent 53824d0e67
commit 1769873118
11 changed files with 160 additions and 112 deletions

View File

@ -1399,7 +1399,7 @@ int ObAccessPathEstimation::process_dynamic_sampling_estimation(ObOptimizerConte
int64_t start_time = ObTimeUtility::current_time();
bool throw_ds_error = false;
if (OB_FAIL(dynamic_sampling.estimate_table_rowcount(ds_table_param, ds_result_items, throw_ds_error))) {
if (!throw_ds_error) {
if (!throw_ds_error && !is_retry_ret(ret)) {
LOG_WARN("failed to estimate table rowcount caused by some reason, please check!!!", K(ret),
K(start_time), K(ObTimeUtility::current_time() - start_time), K(ds_table_param),
K(ctx.get_session_info()->get_current_query_string()));

View File

@ -47,6 +47,8 @@ public:
static int estimate_full_table_rowcount(ObOptimizerContext &ctx,
const ObTablePartitionInfo &table_part_info,
ObTableMetaInfo &meta);
static bool is_retry_ret(int ret);
private:
static int process_common_estimate_rowcount(ObOptimizerContext &ctx,
@ -207,8 +209,6 @@ private:
common::ObIArray<AccessPath *> &ds_paths,
common::ObIArray<AccessPath *> &no_ds_paths,
bool &all_path_is_get);
static bool is_retry_ret(int ret);
};
}

View File

@ -29,6 +29,7 @@
#include "sql/optimizer/ob_join_order.h"
#include "common/ob_smart_call.h"
#include "share/stat/ob_dbms_stats_utils.h"
#include "sql/optimizer/ob_access_path_estimation.h"
using namespace oceanbase::common;
using namespace oceanbase::share::schema;
@ -658,7 +659,7 @@ int ObOptSelectivity::calc_selectivity_by_dynamic_sampling(const OptSelectivityC
int64_t start_time = ObTimeUtility::current_time();
bool throw_ds_error = false;
if (OB_FAIL(dynamic_sampling.estimate_table_rowcount(ds_table_param, ds_result_items, throw_ds_error))) {
if (!throw_ds_error) {
if (!throw_ds_error && !ObAccessPathEstimation::is_retry_ret(ret)) {
LOG_WARN("failed to estimate filter rowcount caused by some reason, please check!!!", K(ret),
K(start_time), K(ObTimeUtility::current_time() - start_time), K(ds_table_param),
K(ctx.get_session_info()->get_current_query_string()));