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
文章來源于領測軟件測試網 http://www.kjueaiud.com/