Fanr

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
-- top 10 引发i/o
SELECT (total_logical_reads/execution_count) AS avg_logical_reads
,(total_logical_writes
/execution_count) AS avg_logical_writes
,(total_physical_reads
/execution_count) AS avg_physical_reads
,execution_count
,(
SELECT SUBSTRING(text,statement_start_offset/2 +1,
(
CASE WHEN statement_end_offset = -1
THEN LEN(CONVERT(NVARCHAR(max),text)) *2
ELSE statement_end_offset
END - statement_start_offset)/2)
FROM sys.dm_exec_sql_text(sql_handle)) AS query_text
FROM sys.dm_exec_query_stats
ORDER BY (total_logical_reads + total_logical_writes)
posted on 2011-03-21 22:07  Fanr_Zh  阅读(376)  评论(0编辑  收藏  举报