Sql-server – Interpreting sp_BlitzCache: # Executions but since when

sp-blitzcachesql server

I'm getting started with sp_BlitzCache (which is amazing!) and trying to understand the results better. When does the # Executions count from? e.g. if it says 343 executions is that today, since server start, or what? I'm running it like this:

sp_blitzCache @MinutesBack = 1440, @sortOrder = 'query hash' 

But the # Executions appears not to change based on the @MinutesBack parameter so I'm guessing it's since some fixed time period?

I'm using SQL 2019.

Best Answer

Scroll across to the right side of the results, and there's a "Created At" column. That column shows when the plan first went into the cache. In most cases, SQL Server tracks the execution count since that time - but there can be exceptions in some cases involving recompiles of a query.

The source is the execution_count column in sys.dm_exec_query_stats.