sys.dm_exec_query_stats
The sys.dm_exec_query_stats DMV displays cumulative query execution statistics for all the queries that are currently in the cache. As we observed in the previous section, the DMV sys.dm_exec_requests shows query performance while the query is executing. Once the query is complete, sys.dm_exec_query_stats is incremented with this new execution information. While query execution plans are stored as a batch, this DMV lists one row per statement, so there may be multiple rows with the same plan_handle and sql_handle. statements. These rows will have a different statement_start_offset and statement_end_offset to distinguish between the statements in the same batch.
There are many different query performance metrics that ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access