What are the practical impacts of the sys.dm_exec_query_stats warning in the documentation?

I've updated the documentation to be more straight-forward on the wording. The intent was to tell the user that running a query against the DMV will produce output only for items that had completed and not for items in-flight. Thus, run the workload in its entirety to make sure all is captured.

The new wording will be the following and applied the various DMVs the previous wording was incorporated into.

The results of sys.dm_exec_query_stats may vary with each execution as the data only reflects finished queries, and not ones still in-flight.


I do not know how to apply the above warning in practice.

That's because it is vague. There is a space at the end of the documentation page to leave feedback. That is pretty much the only way someone will be able to look into the history of that documentation page and see why that warning was added, if it is still necessary, or needs to be updated.

I took a quick look at the implementation on SQL Server 2017 CU 15 and it seems there is no special reason to expect inconsistency (or "inaccuracy"), aside from the totals only being updated at the end of each statement execution.

Tags:

Sql Server

Dmv