Sql-server – Getting ratio of reads to writes on SQL Server

performancesql-server-2008statistics

Sorry I am not a DBA so bear with me. I wanted to get a better understanding of the ratio of reads to writes in our archiecture. The best to get this is at the database. We are using SQL Server 2008. Is there anyway to get this without impacting performance and to get smart summaries? For example, the daily read / write ratio?

Many thanks.

Best Answer

This will be incomplete, but it will give you a good idea of the ratios you're looking for. You can use sys.dm_db_index_usage_stats to retreive the access from various indexes on the system. If you combine the seeks, scans, and lookups you'll get a good idea of the reads. Something like this:

SELECT  ddius.user_updates,
        ddius.user_lookups + ddius.user_scans + ddius.user_seeks AS user_reads
FROM    sys.dm_db_index_usage_stats AS ddius

This data is cumulative, so you'll need to capture the previous day in order to find the differences between yesterday & today. As I say, this won't give you a perfect measure, but it will move you in the right direction.