SQL语句:查看排名前五的SQL语句耗时情况
时间:2021-07-01 10:21:17
帮助过:1人阅读
TOP 5
total_worker_time ,
last_worker_time ,
max_worker_time ,
min_worker_time ,
SUBSTRING(st.
text, ( qs.statement_start_offset
/ 2 )
+ 1,
( ( CASE statement_end_offset
WHEN -1 THEN DATALENGTH(st.
text)
ELSE qs.statement_end_offset
END - qs.statement_start_offset )
/ 2 )
+ 1)
AS statement_text
FROM sys.dm_exec_query_stats
AS qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle)
AS st
ORDER BY max_worker_time
DESC
SQL语句:查看排名前五的SQL语句耗时情况
标签: