The query_thread_profile XEvent

SQL Server 2016 Service Pack 1 introduced a new XEvent named query_thread_profile. Unlike the query_post_execution_showplan XEvent, which uses only Standard Profiling, query_thread_profile uses lightweight profiling by default. Also, unlike query_post_execution_showplan, query_thread_profile doesn't output a query execution plan as a single showplan XML—it outputs one event per-operator and thread with the same execution statistics that are expected in a query execution plan. This means that it can be quite verbose, but since it's based on lightweight profiling rather than Standard Profiling, it can be used for a longer period of time than was possible with query_post_execution_showplan.

The following example ...

Get Learn T-SQL Querying now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.