DBTuna Free Trial

Where are my SQL execution counts?!?


If you have the situation whereby you are missing the execution count figures against certain SQL Statements or Stored Procedures in the DBTuna Activity Screen, then you are probably wondering whats going on! 

In SQL Server 2005 Microsoft introduced something called the Dynamic Management Views or DMVs. These DMVs enhanced the internal instrumentation of SQL Server greatly, and as a result it was possible to pull out lots more information related to usage and performance with scripts, or with tools like DBTuna. One such view called sys.dm_exec_query_stats was very useful for pulling metrics about which queries are running, and how often; DBTuna takes advantage of this view in order to correlate metrics with its own data.

The problem however lies in the fact that sys.dm_exec_query_stats does not store stats on all SQL and Stored Procedure types, therefore DBTuna will miss some data (e.g. Execution Count) for certain types of query. If your SQL batch or Stored Procedure is selecting data, then DBTuna will almost certainly correlate the stats. If your query is "not shareable" e.g. maybe some DML, or a backup job, or apparently any Stored Procedure which contains temporary table creation, then DBTuna will most likely miss it.

So... this explains the situation, and I'm afraid there is no solution we can make to fill in these holes in SQL Server stats.

It just go's to show however that people who rely only on their DMV scripts are most likely missing lots of database activity (which DBTuna will collect).

Next Step - Improve Your Database Performance now with DBTuna: REQUEST A DEMO START A FREE TRIAL