Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 在UTU.dbo中运行
- SELECT
- total_physical_reads * 8 / 1024 "总物理读(Mb)",
- total_logical_reads * 8 / 1024 "总逻辑读(Mb)",
- total_logical_writes * 8 / 1024 "总逻辑写(Mb)",
- total_worker_time /1000/1000 "总CPU耗时(s)",
- creation_time 初次执行时间,
- last_execution_time 上次执行时间,
- execution_count 总运行次数,
- execution_count / (DATEDIFF(day, creation_time, last_execution_time) + 1) 平均每天运行次数,
- total_logical_writes / execution_count * 8 "平均逻辑写(Kb)",
- total_elapsed_time /1000/1000 "总用时(s)",
- total_elapsed_time / execution_count /1000/1000 "平均耗时(s)",
- 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 ) st
- ORDER BY
- total_elapsed_time desc,
- total_elapsed_time / execution_count DESC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement