SQL statement to query the current database IO waiting status

Time:2021-4-2

sys.dm_ io_ pending_ io_ Requests can return the Current IO pending status. For each pending I / O request in SQL server, a corresponding line is returned, followed by sys.dm_ io_ virtual_ file_ With stats, you can see which database IO has problems.


select DB_NAME(database_id) as DBNAME,
    database_id,
    file_id,
    io_stall,
    io_pending_ms_ticks,
    scheduler_address
from sys.dm_io_virtual_file_stats(null,null)i ,
sys.dm_io_pending_io_requests s
where s.io_handle = i.file_handle

Recommended Today

Analysis of super comprehensive MySQL statement locking (Part 1)

A series of articles: Analysis of super comprehensive MySQL statement locking (Part 1) Analysis of super comprehensive MySQL statement locking (Part 2) Analysis of super comprehensive MySQL statement locking (Part 2) Preparation in advance Build a system to store heroes of the Three KingdomsheroTable: CREATE TABLE hero ( number INT, name VARCHAR(100), country varchar(100), PRIMARY […]