sp_BlitzCache®: Free SQL Server Plan Cache Analysis Script

sp_BlitzCache®: Find Your Worst-Performing Queries

You have a SQL Server and you’re not sure which queries are causing your biggest performance problems. You don’t know where to start or if there are hidden queries that are making your main queries slower. You want a fast tool to find the worst queries in the SQL Server plan cache, tell you why they’re bad, and even tell you what you can do about them. sp_BlitzCache® provides the in-depth analysis that you’re looking for. Here’s how it works.

Download it in our free First Responder Kit.

Common sp_BlitzCache parameters

  • @SortOrder – find the worst queries sorted by reads, CPU, duration, executions, memory grant, or recent compilations. Just use sp_BlitzCache @SortOrder = ‘reads’ for example.
  • @Top – by default, we only look at the top 10 queries, but you can use a larger number here like @Top = 50. Just know that the more queries you analyze, the slower it goes.
  • @ExpertMode = 1 – turns on the more-detailed analysis of things like memory grants.
  • @ExportToExcel = 1 – excludes result set columns that would make Excel blow chunks when you copy/paste the results into Excel, like the execution plans. Good for sharing the plan cache metrics with other folks on your team.
  • @Help = 1 – explains the rest of sp_BlitzCache’s parameters, plus the output columns as well.

How to learn more and get support

In our spare time, between ogling tasting menus, we build more stuff to help:

Want training on this?

In my How I Use the First Responder Kit class, I teach you the most important parameters and how I use them in my day-to-day work.

Once you’ve conquered that, my Fundamentals classes cover index tuning, query tuning, TempDB, running SQL Server in the cloud, and much more.

Brent Ozar

Want consulting help?

Don’t have time to learn the hard way? I’m here to help with a quick, easy process that gets to the root cause of your database health and performance pains. Learn more, see sample reports, and book a free call with me.