Case study – 1,266% faster!

Real sample

The procedure below was extracted from a  stored procedure that was found during a database Assessment.

It was causing CPU pressure on the client’s server.

Using the query store

Using it, you can review a list of the highest resource consuming queries and drill down further by selecting individual queries to view more details.

Figure 1 – Top resource consuming queries by CPU time.

What was done

  • Replace the table variables with temporary tables;
  • Create a indexed view and replaced a subquery with it.

The results

Sometimes changes can make TSQL run 20,000% faster, sometimes 50%, other times slicing 20% off the cost is a great help.

Tuning results vary. They vary based on the query’s complexity, how much tuning has gone into it already, etc.

But we rarely can’t make T-SQL perform faster.

We can solve your database performance problems! Contact us!

Mark Varnas

Mark Varnas

I love making performance tuning SQL Servers fast and making them more stable. And I channel that obsession into our SQL Managed Services and new content here. When I'm not writing about SQL, I spend time outside hiking, skiing, mountain biking, or trying a new recipe.

Leave a Reply

Your email address will not be published. Required fields are marked *