[CP] spm only accepts successfully executed plans as baseline

This commit is contained in:
obdev
2022-12-15 13:11:45 +00:00
committed by ob-robot
parent 2ff985ffdd
commit c91594425b
7 changed files with 21 additions and 21 deletions

View File

@ -3714,6 +3714,7 @@ OB_NOINLINE int ObSql::handle_physical_plan(const ObString &trimed_stmt,
bool add_plan_to_pc = false;
ObSQLSessionInfo &session = result.get_session();
ObPlanCache *plan_cache = session.get_plan_cache();
ObSpmCacheCtx &spm_ctx = context.spm_ctx_;
bool use_plan_cache = session.get_local_ob_enable_plan_cache();
// record whether needs to do parameterization at this time,
// if exact mode is on, not do parameterizaiton
@ -3723,7 +3724,7 @@ OB_NOINLINE int ObSql::handle_physical_plan(const ObString &trimed_stmt,
pc_ctx.neg_param_index_.reset();
bool plan_added = false;
bool need_get_baseline = false;
LOG_DEBUG("gen plan info", K(context.spm_ctx_.bl_key_), K(get_plan_err));
LOG_DEBUG("gen plan info", K(spm_ctx.bl_key_), K(get_plan_err));
// for batched multi stmt, we only parse and optimize the first statement
// only in multi_query, need do this
if (!is_psmode &&