bin/XEtemplates/Query Wait Statistics Detail.xml
<event_sessions xmlns="http://schemas.microsoft.com/sqlserver/2008/07/extendedeventconfig">
<event_session name="Query Wait Statistics Detail" maxMemory="4" eventRetentionMode="allowSingleEventLoss" trackCausality="true" dispatchLatency="30" maxEventSize="0" memoryPartitionMode="none"> <templateCategory> <!-- _locID_text="templateCategory" _locComment = "" -->Query Execution</templateCategory> <templateName> <!-- _locID_text = "templateName" _locComment = "" -->Query Wait Statistics Detail</templateName> <templateDescription> <!-- _locID_text = "templateDescription" _locComment = "" -->Tracks internal and external wait statistics for individual query statements, batches and RPCs. This template also collects the query hash and query plan hash for every statement it tracks. Events are only collected from 20% of the active sessions on the server at any given time. You can change the sampling rate by modifying the filter for the event session.</templateDescription> <event package="sqlos" name="wait_info"> <action package="sqlserver" name="client_app_name" /> <action package="sqlserver" name="database_id" /> <action package="sqlserver" name="query_hash" /> <action package="sqlserver" name="query_plan_hash" /> <action package="sqlserver" name="session_id" /> <predicate> <and> <and> <leaf> <comparator name="divides_by_uint64" package="package0"></comparator> <global name="session_id" package="sqlserver"></global> <value>5</value> </leaf> <leaf> <comparator name="greater_than_uint64" package="package0"></comparator> <global name="database_id" package="sqlserver"></global> <value>4</value> </leaf> </and> <leaf> <comparator name="equal_boolean" package="package0"></comparator> <global name="is_system" package="sqlserver"></global> <value>false</value> </leaf> </and> </predicate> </event> <event package="sqlos" name="wait_info_external"> <action package="sqlserver" name="client_app_name" /> <action package="sqlserver" name="database_id" /> <action package="sqlserver" name="query_hash" /> <action package="sqlserver" name="query_plan_hash" /> <action package="sqlserver" name="session_id" /> <predicate> <and> <and> <leaf> <comparator name="divides_by_uint64" package="package0"></comparator> <global name="session_id" package="sqlserver"></global> <value>5</value> </leaf> <leaf> <comparator name="greater_than_uint64" package="package0"></comparator> <global name="database_id" package="sqlserver"></global> <value>4</value> </leaf> </and> <leaf> <comparator name="equal_boolean" package="package0"></comparator> <global name="is_system" package="sqlserver"></global> <value>false</value> </leaf> </and> </predicate> </event> <event package="sqlserver" name="rpc_completed"> <action package="sqlserver" name="client_app_name" /> <action package="sqlserver" name="database_id" /> <action package="sqlserver" name="query_hash" /> <action package="sqlserver" name="session_id" /> <predicate> <and> <and> <leaf> <comparator name="divides_by_uint64" package="package0"></comparator> <global name="session_id" package="sqlserver"></global> <value>5</value> </leaf> <leaf> <comparator name="greater_than_uint64" package="package0"></comparator> <global name="database_id" package="sqlserver"></global> <value>4</value> </leaf> </and> <leaf> <comparator name="equal_boolean" package="package0"></comparator> <global name="is_system" package="sqlserver"></global> <value>false</value> </leaf> </and> </predicate> </event> <event package="sqlserver" name="rpc_starting"> <action package="sqlserver" name="client_app_name" /> <action package="sqlserver" name="database_id" /> <action package="sqlserver" name="query_hash" /> <action package="sqlserver" name="session_id" /> <predicate> <and> <and> <leaf> <comparator name="divides_by_uint64" package="package0"></comparator> <global name="session_id" package="sqlserver"></global> <value>5</value> </leaf> <leaf> <comparator name="greater_than_uint64" package="package0"></comparator> <global name="database_id" package="sqlserver"></global> <value>4</value> </leaf> </and> <leaf> <comparator name="equal_boolean" package="package0"></comparator> <global name="is_system" package="sqlserver"></global> <value>false</value> </leaf> </and> </predicate> </event> <event package="sqlserver" name="sp_statement_completed"> <action package="sqlserver" name="client_app_name" /> <action package="sqlserver" name="database_id" /> <action package="sqlserver" name="query_hash" /> <action package="sqlserver" name="query_plan_hash" /> <action package="sqlserver" name="session_id" /> <parameter name="collect_object_name" value="1" /> <parameter name="collect_statement" value="1" /> <predicate> <and> <and> <leaf> <comparator name="divides_by_uint64" package="package0"></comparator> <global name="session_id" package="sqlserver"></global> <value>5</value> </leaf> <leaf> <comparator name="greater_than_uint64" package="package0"></comparator> <global name="database_id" package="sqlserver"></global> <value>4</value> </leaf> </and> <leaf> <comparator name="equal_boolean" package="package0"></comparator> <global name="is_system" package="sqlserver"></global> <value>false</value> </leaf> </and> </predicate> </event> <event package="sqlserver" name="sp_statement_starting"> <action package="sqlserver" name="client_app_name" /> <action package="sqlserver" name="database_id" /> <action package="sqlserver" name="query_hash" /> <action package="sqlserver" name="query_plan_hash" /> <action package="sqlserver" name="session_id" /> <predicate> <and> <and> <leaf> <comparator name="divides_by_uint64" package="package0"></comparator> <global name="session_id" package="sqlserver"></global> <value>5</value> </leaf> <leaf> <comparator name="greater_than_uint64" package="package0"></comparator> <global name="database_id" package="sqlserver"></global> <value>4</value> </leaf> </and> <leaf> <comparator name="equal_boolean" package="package0"></comparator> <global name="is_system" package="sqlserver"></global> <value>false</value> </leaf> </and> </predicate> </event> <event package="sqlserver" name="sql_batch_completed"> <action package="sqlserver" name="client_app_name" /> <action package="sqlserver" name="database_id" /> <action package="sqlserver" name="query_hash" /> <action package="sqlserver" name="session_id" /> <predicate> <and> <and> <leaf> <comparator name="divides_by_uint64" package="package0"></comparator> <global name="session_id" package="sqlserver"></global> <value>5</value> </leaf> <leaf> <comparator name="greater_than_uint64" package="package0"></comparator> <global name="database_id" package="sqlserver"></global> <value>4</value> </leaf> </and> <leaf> <comparator name="equal_boolean" package="package0"></comparator> <global name="is_system" package="sqlserver"></global> <value>false</value> </leaf> </and> </predicate> </event> <event package="sqlserver" name="sql_batch_starting"> <action package="sqlserver" name="client_app_name" /> <action package="sqlserver" name="database_id" /> <action package="sqlserver" name="query_hash" /> <action package="sqlserver" name="session_id" /> <predicate> <and> <and> <leaf> <comparator name="divides_by_uint64" package="package0"></comparator> <global name="session_id" package="sqlserver"></global> <value>5</value> </leaf> <leaf> <comparator name="greater_than_uint64" package="package0"></comparator> <global name="database_id" package="sqlserver"></global> <value>4</value> </leaf> </and> <leaf> <comparator name="equal_boolean" package="package0"></comparator> <global name="is_system" package="sqlserver"></global> <value>false</value> </leaf> </and> </predicate> </event> <event package="sqlserver" name="sql_statement_completed"> <action package="sqlserver" name="client_app_name" /> <action package="sqlserver" name="database_id" /> <action package="sqlserver" name="query_hash" /> <action package="sqlserver" name="query_plan_hash" /> <action package="sqlserver" name="session_id" /> <predicate> <and> <and> <leaf> <comparator name="divides_by_uint64" package="package0"></comparator> <global name="session_id" package="sqlserver"></global> <value>5</value> </leaf> <leaf> <comparator name="greater_than_uint64" package="package0"></comparator> <global name="database_id" package="sqlserver"></global> <value>4</value> </leaf> </and> <leaf> <comparator name="equal_boolean" package="package0"></comparator> <global name="is_system" package="sqlserver"></global> <value>false</value> </leaf> </and> </predicate> </event> <event package="sqlserver" name="sql_statement_starting"> <action package="sqlserver" name="client_app_name" /> <action package="sqlserver" name="database_id" /> <action package="sqlserver" name="query_hash" /> <action package="sqlserver" name="query_plan_hash" /> <action package="sqlserver" name="session_id" /> <predicate> <and> <and> <leaf> <comparator name="divides_by_uint64" package="package0"></comparator> <global name="session_id" package="sqlserver"></global> <value>5</value> </leaf> <leaf> <comparator name="greater_than_uint64" package="package0"></comparator> <global name="database_id" package="sqlserver"></global> <value>4</value> </leaf> </and> <leaf> <comparator name="equal_boolean" package="package0"></comparator> <global name="is_system" package="sqlserver"></global> <value>false</value> </leaf> </and> </predicate> </event> <target package="package0" name="event_file"> <parameter name="filename" value="query_wait_analysis.xel" /> </target> </event_session> </event_sessions> |