sql service 查询历史语句

SELECT st.text as sql_statement,
qs.creation_time as plan_last_compiled,
qs.last_execution_time as plan_last_executed,
qs.execution_count as plan_executed_count,
qp.query_plan
FROM sys.dm_exec_query_stats qs
CROSS APPLY sys.dm_exec_sql_text(qs.plan_handle) st
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) qp
WHERE qs.creation_time >= ‘2020-04-09 16:36:57.110‘
order by total_elapsed_time/execution_count desc

sql service 查询历史语句

上一篇:mysql 清楚多列重复数据只保留其中一条


下一篇:数据可视化基础专题(四):Pandas基础(三) mysql导入与导出