Skip to content

Instantly share code, notes, and snippets.

@efvincent
Last active October 11, 2015 20:24
Show Gist options
  • Select an option

  • Save efvincent/ad4f2632a5081fb8925c to your computer and use it in GitHub Desktop.

Select an option

Save efvincent/ad4f2632a5081fb8925c to your computer and use it in GitHub Desktop.
TempDB file performance
SELECT files.physical_name, files.name,
stats.num_of_writes, (1.0 * stats.io_stall_write_ms / stats.num_of_writes) AS avg_write_stall_ms,
stats.num_of_reads, (1.0 * stats.io_stall_read_ms / stats.num_of_reads) AS avg_read_stall_ms
FROM sys.dm_io_virtual_file_stats(2, NULL) as stats
INNER JOIN master.sys.master_files AS files
ON stats.database_id = files.database_id
AND stats.file_id = files.file_id
WHERE files.type_desc = 'ROWS'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment