Last active
August 29, 2015 14:05
-
-
Save ronmichael/bd2208e0307a3c12e735 to your computer and use it in GitHub Desktop.
Analyze MSSQL tempdb performance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
files.physical_name, | |
files.name, | |
stats.num_of_writes, (1.0 * stats.io_stall_write_ms / stats.num_of_writes) avg_write_stall_ms, | |
stats.num_of_reads, (1.0 * stats.io_stall_read_ms / stats.num_of_reads) avg_read_stall_ms | |
FROM sys.dm_io_virtual_file_stats(2, NULL) as stats | |
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' | |
/* | |
Best practice: Create 3-4 or more tempdbs to distribute load; ideally on different drives; should be identical size | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment