May 2019
Intermediate to advanced
484 pages
11h 23m
English
SQL Server 2016 SP2 CU3 and SQL Server 2017 CU11 introduced a new XEvent named query_plan_profile. This XEvent outputs the equivalent of a query execution plan such as the query_post_execution_showplan XEvent. Unlike the query_post_execution_showplan XEvent, which uses Standard Profiling, query_plan_profile uses lightweight profiling by default.
The query_plan_profile XEvent allows a very targeted plan collection that can be used for a longer period of time to gather data for a specific query execution and doesn't require any object or statement filtering in the XEvent session. This is because the XEvent only fires for a query or queries that are using the USE HINT ('QUERY_PLAN_PROFILE') hint.
The following is ...