dbid,
objectid
from sys.dm_exec_query_stats a
cross apply sys.dm_exec_sql_text(sql_handle) as sql_text
where plan_generation_num > 1
order by plan_generation_num desc
select top 25
sql_text.text,
sql_handle,
plan_generation_num,
execution_count,
dbid,
objectid
from sys.dm_exec_query_stats a
cross apply sys.dm_exec_sql_text(sql_handle) as sql_text
where plan_generation_num > 1
order by plan_generation_num desc
效率较低的查询计划可能增大 CPU 占用率。
下面的查询显示哪个查询占用了最多的 CPU 累计使用率。
view plaincopy to clipboardprint?
SELECT
文章来源于领测软件测试网 https://www.ltesting.net/