disable gather hidden table stats and add estimate block cnt trace point for analyze

This commit is contained in:
wangt1xiuyi
2024-01-24 03:17:26 +00:00
committed by ob-robot
parent 6aeab8d323
commit d992246eb3
5 changed files with 11 additions and 5 deletions

View File

@ -1200,7 +1200,8 @@ int ObDbmsStatsExecutor::gather_index_stats(ObExecContext &ctx,
ObModIds::OB_HASH_BUCKET_TABLE_STATISTICS,
param.tenant_id_))) {
LOG_WARN("failed to create hash map", K(ret));
} else if (OB_FAIL(ObBasicStatsEstimator::estimate_block_count(ctx, param,
} else if (param.need_estimate_block_ &&
OB_FAIL(ObBasicStatsEstimator::estimate_block_count(ctx, param,
partition_id_block_map))) {
LOG_WARN("failed to estimate block count", K(ret));
} else if (OB_FAIL(ObDbmsStatsUtils::prepare_gather_stat_param(param, INVALID_LEVEL, &partition_id_block_map,

View File

@ -328,7 +328,7 @@ int ObDbmsStatsPreferences::get_sys_default_stat_options(ObExecContext &ctx,
} else if (OB_FAIL(get_no_acquired_prefs(stat_prefs, no_acquired_prefs))) {
LOG_WARN("failed to get no acquired prefs", K(ret));
} else if (no_acquired_prefs.empty()) {//have got all expected sys prefs from user prefs sys table
LOG_TRACE("succeed to get sys default stat options", K(stat_prefs), K(param));
LOG_TRACE("succeed to get sys default stat options", K(param));
} else {//try get sys prefs from global prefs sys table
raw_sql.reset();
sname_list.reset();
@ -631,7 +631,7 @@ int ObDbmsStatsPreferences::do_get_sys_perfs(ObExecContext &ctx,
LOG_WARN("failed to get result", K(ret));
} else {
ret = OB_SUCCESS;
LOG_TRACE("Succeed to do get sys perfs", K(raw_sql), K(need_acquired_prefs));
LOG_TRACE("Succeed to do get sys perfs", K(raw_sql), K(param));
}
}
int tmp_ret = OB_SUCCESS;

View File

@ -178,7 +178,7 @@ int ObDbmsStatsUtils::check_is_stat_table(share::schema::ObSchemaGetterGuard &sc
is_valid = !is_no_stat_virtual_table(table_id);
} else if (OB_FAIL(schema_guard.get_table_schema(tenant_id, table_id, table_schema))) {
LOG_WARN("failed to get table schema", K(ret), K(tenant_id), K(table_id));
} else if (OB_ISNULL(table_schema)) {
} else if (OB_ISNULL(table_schema) || OB_UNLIKELY(!table_schema->is_normal_schema())) {
//do nothing
} else {//check user table
is_valid = table_schema->is_user_table() || table_schema->is_external_table();

View File

@ -259,7 +259,8 @@ int ObIndexStatsEstimator::fast_gather_index_stats(ObExecContext &ctx,
ObModIds::OB_HASH_BUCKET_TABLE_STATISTICS,
index_param.tenant_id_))) {
LOG_WARN("failed to create hash map", K(ret));
} else if (OB_FAIL(ObBasicStatsEstimator::estimate_block_count(ctx, index_param, partition_id_block_map))) {
} else if (index_param.need_estimate_block_ &&
OB_FAIL(ObBasicStatsEstimator::estimate_block_count(ctx, index_param, partition_id_block_map))) {
LOG_WARN("failed to estimate block count", K(ret));
} else {
bool is_continued = true;

View File

@ -151,6 +151,10 @@ int ObAnalyzeTableInfo::fill_table_stat_param(ObExecContext &ctx, common::ObTabl
if (param.part_stat_param_.need_modify_ && param.subpart_stat_param_.need_modify_) {
param.part_stat_param_.can_use_approx_ = true;
}
bool no_estimate_block = (OB_E(EventTable::EN_LEADER_STORAGE_ESTIMATION) OB_SUCCESS) != OB_SUCCESS;
if (no_estimate_block) {
param.need_estimate_block_ = false;
}
}
LOG_TRACE("link bug", K(param));