HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Getting ratio of reads to writes on SQL Server

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
writessqlgettingreadsserverratio

Problem

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.

Solution

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.

Code Snippets

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

Context

StackExchange Database Administrators Q#15046, answer score: 4

Revisions (0)

No revisions yet.