diff --git a/src/observer/mysql/obmp_query.cpp b/src/observer/mysql/obmp_query.cpp index 3de1243eca..9ae0839f20 100644 --- a/src/observer/mysql/obmp_query.cpp +++ b/src/observer/mysql/obmp_query.cpp @@ -975,20 +975,17 @@ OB_INLINE int ObMPQuery::do_process(ObSQLSessionInfo &session, if (!(ctx_.self_add_plan_) && ctx_.plan_cache_hit_) { plan->update_plan_stat(audit_record, false, // false mean not first update plan stat - result.get_exec_context().get_is_evolution(), table_row_count_list); plan->update_cache_access_stat(audit_record.table_scan_stat_); } else if (ctx_.self_add_plan_ && !ctx_.plan_cache_hit_) { plan->update_plan_stat(audit_record, true, - result.get_exec_context().get_is_evolution(), table_row_count_list); plan->update_cache_access_stat(audit_record.table_scan_stat_); } else if (ctx_.self_add_plan_ && ctx_.plan_cache_hit_) { // spm evolution plan first execute plan->update_plan_stat(audit_record, true, - result.get_exec_context().get_is_evolution(), table_row_count_list); plan->update_cache_access_stat(audit_record.table_scan_stat_); } diff --git a/src/observer/mysql/obmp_stmt_execute.cpp b/src/observer/mysql/obmp_stmt_execute.cpp index 09da0c3ecd..c141f80aed 100644 --- a/src/observer/mysql/obmp_stmt_execute.cpp +++ b/src/observer/mysql/obmp_stmt_execute.cpp @@ -1405,20 +1405,17 @@ int ObMPStmtExecute::do_process(ObSQLSessionInfo &session, if (!(ctx_.self_add_plan_) && ctx_.plan_cache_hit_) { plan->update_plan_stat(audit_record, false, // false mean not first update plan stat - result.get_exec_context().get_is_evolution(), table_row_count_list); plan->update_cache_access_stat(audit_record.table_scan_stat_); } else if (ctx_.self_add_plan_ && !ctx_.plan_cache_hit_) { plan->update_plan_stat(audit_record, true, - result.get_exec_context().get_is_evolution(), table_row_count_list); plan->update_cache_access_stat(audit_record.table_scan_stat_); } else if (ctx_.self_add_plan_ && ctx_.plan_cache_hit_) { // spm evolution plan first execute plan->update_plan_stat(audit_record, true, - result.get_exec_context().get_is_evolution(), table_row_count_list); plan->update_cache_access_stat(audit_record.table_scan_stat_); } diff --git a/src/observer/ob_inner_sql_connection.cpp b/src/observer/ob_inner_sql_connection.cpp index 89a19885a1..56f50701ac 100644 --- a/src/observer/ob_inner_sql_connection.cpp +++ b/src/observer/ob_inner_sql_connection.cpp @@ -639,12 +639,10 @@ int ObInnerSQLConnection::process_audit_record(sql::ObResultSet &result_set, if (!(sql_ctx.self_add_plan_) && sql_ctx.plan_cache_hit_) { plan->update_plan_stat(audit_record, false, // false mean not first update plan stat - result_set.get_exec_context().get_is_evolution(), table_row_count_list); } else if (sql_ctx.self_add_plan_ && !sql_ctx.plan_cache_hit_) { plan->update_plan_stat(audit_record, true, - result_set.get_exec_context().get_is_evolution(), table_row_count_list); } } diff --git a/src/sql/engine/ob_exec_context.cpp b/src/sql/engine/ob_exec_context.cpp index 3d024247c0..e32013fae2 100644 --- a/src/sql/engine/ob_exec_context.cpp +++ b/src/sql/engine/ob_exec_context.cpp @@ -92,7 +92,6 @@ ObExecContext::ObExecContext(ObIAllocator &allocator) row_id_list_(nullptr), row_id_list_array_(), total_row_count_(0), - is_evolution_(false), reusable_interm_result_(false), is_async_end_trans_(false), gi_task_map_(nullptr), diff --git a/src/sql/engine/ob_exec_context.h b/src/sql/engine/ob_exec_context.h index 940fb9151f..5a2d003414 100644 --- a/src/sql/engine/ob_exec_context.h +++ b/src/sql/engine/ob_exec_context.h @@ -383,8 +383,6 @@ public: int64_t get_row_id_list_total_count() const { return total_row_count_; } void set_plan_start_time(int64_t t) { phy_plan_ctx_->set_plan_start_time(t); } int64_t get_plan_start_time() const { return phy_plan_ctx_->get_plan_start_time(); } - void set_is_evolution(bool v) { is_evolution_ = v; } - bool get_is_evolution() const { return is_evolution_; } void set_is_ps_prepare_stage(bool v) { is_ps_prepare_stage_ = v; } bool is_ps_prepare_stage() const { return is_ps_prepare_stage_; } @@ -590,9 +588,6 @@ protected: ObRowIdListArray row_id_list_array_; //判断现在执行的计划是否为演进过程中的计划 int64_t total_row_count_; - // ----------------------- - - bool is_evolution_; // Interminate result of index building is reusable, reused in build index retry with same snapshot. // Reusable intermediate result is not deleted in the close phase, deleted deliberately after // execution is completed. diff --git a/src/sql/engine/ob_physical_plan.cpp b/src/sql/engine/ob_physical_plan.cpp index e16426d1ac..6053f17b3c 100644 --- a/src/sql/engine/ob_physical_plan.cpp +++ b/src/sql/engine/ob_physical_plan.cpp @@ -473,7 +473,6 @@ int ObPhysicalPlan::init_operator_stats() void ObPhysicalPlan::update_plan_stat(const ObAuditRecordData &record, const bool is_first, - const bool is_evolution, const ObIArray *table_row_count_list) { const int64_t current_time = ObClockGenerator::getClock(); diff --git a/src/sql/engine/ob_physical_plan.h b/src/sql/engine/ob_physical_plan.h index c34672576a..c8299f54b6 100644 --- a/src/sql/engine/ob_physical_plan.h +++ b/src/sql/engine/ob_physical_plan.h @@ -126,7 +126,6 @@ public: */ void update_plan_stat(const ObAuditRecordData &record, const bool is_first, - const bool is_evolution, const ObIArray *table_row_count_list); void update_cache_access_stat(const ObTableScanStat &scan_stat) { diff --git a/src/sql/executor/ob_remote_executor_processor.cpp b/src/sql/executor/ob_remote_executor_processor.cpp index 28a0fc0589..882eeee77d 100644 --- a/src/sql/executor/ob_remote_executor_processor.cpp +++ b/src/sql/executor/ob_remote_executor_processor.cpp @@ -612,12 +612,10 @@ void ObRemoteBaseExecuteP::record_sql_audit_and_plan_stat( if (!exec_ctx_.get_sql_ctx()->self_add_plan_ && exec_ctx_.get_sql_ctx()->plan_cache_hit_) { mutable_plan->update_plan_stat(audit_record, false, // false mean not first update plan stat - exec_ctx_.get_is_evolution(), table_row_count_list); } else if (exec_ctx_.get_sql_ctx()->self_add_plan_ && !exec_ctx_.get_sql_ctx()->plan_cache_hit_) { mutable_plan->update_plan_stat(audit_record, true, - exec_ctx_.get_is_evolution(), table_row_count_list); } diff --git a/src/sql/ob_sql.cpp b/src/sql/ob_sql.cpp index 7be381cbc1..1398c1fae2 100644 --- a/src/sql/ob_sql.cpp +++ b/src/sql/ob_sql.cpp @@ -3952,7 +3952,7 @@ int ObSql::execute_get_plan(ObPlanCache &plan_cache, if (OB_SQL_PC_NOT_EXIST == ret || OB_PC_LOCK_CONFLICT == ret) { // do nothing } else { - LOG_WARN("fail to get physical plan", K(ret)); + LOG_WARN("fail to get physical plan", K(ret), KPC(guard.get_cache_obj())); } } } diff --git a/src/sql/spm/ob_spm_evolution_plan.h b/src/sql/spm/ob_spm_evolution_plan.h index 719518abea..7f73b62756 100644 --- a/src/sql/spm/ob_spm_evolution_plan.h +++ b/src/sql/spm/ob_spm_evolution_plan.h @@ -139,8 +139,8 @@ private: bool &is_same) const; int is_evolving_plan_better(bool &is_better) const; int process_plan_evolution_result(const bool is_better); - int discard_evolving_plan_add_baseline_plan_to_pc(ObPlanCacheCtx &ctx); - int discard_baseline_plan_add_evolving_plan_to_pc(ObPlanCacheCtx &ctx); + void discard_evolving_plan_add_baseline_plan_to_pc(ObPlanCacheCtx &ctx); + void discard_baseline_plan_add_evolving_plan_to_pc(ObPlanCacheCtx &ctx); int discard_all_plan_by_type(EvolutionPlanType plan_type, bool evict_plan = false); int add_evolving_plan_to_pc(ObPlanCacheCtx &ctx); int add_all_baseline_plans_to_pc(ObPlanCacheCtx &ctx);