Capacity freed
80%less CPU per run
It was one of the top resource consumers on the server. Two indexes cut the average run from 142 ms to 32 ms.
CPU per run
Source: average of multiple runs.
Reading from disk is the slowest operation SQL Server does.
Therefore, tuning for less disk “reads” is often the target.
The problem
The stored procedure showed up in the top resource-consuming report. It was putting too much stress on the CPU.

The fix
To fix this issue, we added two new indexes.

Why does disk improvement matter for stored procedure speed?
The less you access the disk, the more disk capacity is left over.
It works just like a highway. Imagine a 3-lane highway with just 5 cars driving on it every minute.
What if you add 50 cars? The speed remains the same because 55 cars don’t overload that highway.
What if you add another 500 or 5,000? Now you are starting a slowdown in traffic.
They all still get home. But not at the same speed anymore.
It's the same deal with SQL Servers. That's why it's important to speed-tune the most critical resources.
The fewer hits to the storage, the more capacity available.
In this tuning session, better performance was achieved by adding two new indexes.
Under the hood
Before and after, every measurement
The improvement was significant: the total number of disk reads decreased to just 266 from 12,805, resulting in a 5x reduction in CPU time!

| Before | After | Improvement | |
|---|---|---|---|
| Duration (ms)* | 142 | 32 | ~4x |
| CPU (ms)* | 157 | 31 | ~5x |
| Disk (number of reads)* | 12,805 | 266 | ~48x |
Overall, we observed a staggering improvement, making the query execution 4 times faster!
As a result - 4 times faster query!


