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

Determine total no of logical/physical reads

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

Problem

I am working on the optimization of a SP which contains some business logic using looping. I have removed the looping and converted those piece of code into some simple insert/update statements.

Now I've to do benchmarking and compare old and new code in terms of execution time and logical/physical reads.

My problem is because of the loop in my old code, how can I determine what is the total no of logical/physical reads. Because in SSMS, I can see thousands of IO stats statements like:

"Table 'Employee'. Scan count 1, logical reads 3, physical reads 0, read-ahead reads 0, lob logical reads 43, lob physical reads 0, lob read-ahead reads 0."

Solution

I can think of 3 options to get the total reads:

  • Extended Event session



  • SQL Profiler



  • IO Statistics Parser



IO Statistics Parser is pretty simple, just copy/paste your STATISTICS IO output and voila!

Context

StackExchange Database Administrators Q#148227, answer score: 6

Revisions (0)

No revisions yet.