
How to Measure IO Latency for Database Files in SQL Server
In order to get information about the amounts of PHYSICAL reads we perform on database files, SQL Server exposes a DMV called sys.dm_io_virtual_file_stats. In addition to information about number of reads and writes, and the amounts of bytes read and written, we also have the io_stall_read_ms, io_stall_write_ms and io_stall, which show information about the amount of time we have to wait when reading from each file. Using the DMV columns, the following script takes a snapshot