sys.dm_io_pending_io_requests as t2
where t1.file_handle = t2.io_handle
select
database_id,
file_id,
io_stall,
io_pending_ms_ticks,
scheduler_address
from sys.dm_io_virtual_file_stats(NULL, NULL)t1,
sys.dm_io_pending_io_requests as t2
where t1.file_handle = t2.io_handle
在正常情况下,该查询通常不返回任何内容。如果此查询返回一些行,则需要进一步调查。
您还可以执行下面的 DMV 查询以查找 I/O 相关查询。
view plaincopy to clipboardprint?
select top 5 (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, statement_start_offset, p.query_plan, q.text
from sys.dm_exec_query_stats
cross apply sys.dm_exec_query_plan(plan_handle) p
cross apply sys.dm_exec_sql_text(plan_handle) as q
文章来源于领测软件测试网 https://www.ltesting.net/