Last active
August 24, 2018 17:45
-
-
Save mvillegascuellar/550e8476f7eebb8c36116be23e3a9ce1 to your computer and use it in GitHub Desktop.
This file contains 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 | |
DB_NAME(mf.database_id) | |
,sum(fs.num_of_reads) as total_reads | |
from sys.master_files mf | |
cross apply sys.dm_io_virtual_file_stats(mf.database_id,NULL) fs | |
where mf.database_id = 2 | |
and mf.type_desc = 'ROWS' | |
group by mf.database_id | |
GO | |
DECLARE @temp1 TABLE (col1 int) | |
insert into @temp1 select database_id from sys.databases | |
DBCC DROPCLEANBUFFERS | |
select count(*) from @temp1 | |
GO | |
select | |
DB_NAME(mf.database_id) | |
,sum(fs.num_of_reads) as total_reads | |
from sys.master_files mf | |
cross apply sys.dm_io_virtual_file_stats(mf.database_id,NULL) fs | |
where mf.database_id = 2 | |
and mf.type_desc = 'ROWS' | |
group by mf.database_id | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment