{"id":550,"date":"2010-12-14T20:40:00","date_gmt":"2010-12-14T20:40:00","guid":{"rendered":"\/blogs\/jonathan\/post\/An-XEvent-a-Day-(14-of-31)-e28093-A-Closer-Look-at-Predicates.aspx"},"modified":"2017-04-13T12:16:42","modified_gmt":"2017-04-13T16:16:42","slug":"an-xevent-a-day-14-of-31-a-closer-look-at-predicates","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\/","title":{"rendered":"An XEvent a Day (14 of 31) \u2013 A Closer Look at Predicates"},"content":{"rendered":"<p>When working with SQL Trace, one of my biggest frustrations has been the limitations that exist in filtering.&#160; Using sp_trace_setfilter to establish the filter criteria is a non-trivial task, and it falls short of being able to deliver complex filtering that is sometimes needed to simplify analysis.&#160; Filtering of trace data was performed globally and applied to the trace affecting all of the events being collected.&#160; Extended Events introduces a much better system of filtering using Predicates that are applied at the individual Event level, allow for short circuiting of evaluation, and provide the ability to create complex groups of independent criteria, ensuring only Events of interest are captured by the Event Session.<\/p>\n<p>In yesterdays post, <a href=\"http:\/\/sqlblog.com\/blogs\/jonathan_kehayias\/archive\/2010\/12\/13\/an-xevent-a-day-13-of-31-the-system-health-session.aspx\" target=\"_blank\">The system_health Session<\/a>, I talked about the default system_health session that is running on every SQL Server 2008\/2008R2 and Denali CTP1 instance out of the box.&#160; The Predicate definition for the sqlos.wait_info event in the system_health session is a good example to follow for complex, short-circuiting Predicate definition in Extended Events.<\/p>\n<blockquote>\n<pre class=\"code\"><span style=\"color: blue\">ADD EVENT <\/span>sqlos<span style=\"color: gray\">.<\/span>wait_info\r\n<span style=\"color: gray\">(\r\n    <\/span><span style=\"color: blue\">ACTION <\/span><span style=\"color: gray\">(<\/span>package0<span style=\"color: gray\">.<\/span>callstack<span style=\"color: gray\">, <\/span>sqlserver<span style=\"color: gray\">.<\/span>session_id<span style=\"color: gray\">, <\/span>sqlserver<span style=\"color: gray\">.<\/span>sql_text<span style=\"color: gray\">)\r\n    <\/span><span style=\"color: blue\">WHERE \r\n    <\/span><span style=\"color: gray\">(<\/span>duration <span style=\"color: gray\">&gt; <\/span>15000 <span style=\"color: gray\">AND \r\n        (    \r\n            (<\/span>wait_type <span style=\"color: gray\">&gt; <\/span>31    <span style=\"color: green\">-- Waits for latches and important wait resources (not locks) \r\n                            -- that have exceeded 15 seconds. \r\n                <\/span><span style=\"color: gray\">AND\r\n                (\r\n                    (<\/span>wait_type <span style=\"color: gray\">&gt; <\/span>47 <span style=\"color: gray\">AND <\/span>wait_type <span style=\"color: gray\">&lt; <\/span>54<span style=\"color: gray\">)\r\n                    OR <\/span>wait_type <span style=\"color: gray\">&lt; <\/span>38\r\n                    <span style=\"color: gray\">OR (<\/span>wait_type <span style=\"color: gray\">&gt; <\/span>63 <span style=\"color: gray\">AND <\/span>wait_type <span style=\"color: gray\">&lt; <\/span>70<span style=\"color: gray\">)\r\n                    OR (<\/span>wait_type <span style=\"color: gray\">&gt; <\/span>96 <span style=\"color: gray\">AND <\/span>wait_type <span style=\"color: gray\">&lt; <\/span>100<span style=\"color: gray\">)\r\n                    OR (<\/span>wait_type <span style=\"color: gray\">= <\/span>107<span style=\"color: gray\">)\r\n                    OR (<\/span>wait_type <span style=\"color: gray\">= <\/span>113<span style=\"color: gray\">)\r\n                    OR (<\/span>wait_type <span style=\"color: gray\">&gt; <\/span>174 <span style=\"color: gray\">AND <\/span>wait_type <span style=\"color: gray\">&lt; <\/span>179<span style=\"color: gray\">)\r\n                    OR (<\/span>wait_type <span style=\"color: gray\">= <\/span>186<span style=\"color: gray\">)\r\n                    OR (<\/span>wait_type <span style=\"color: gray\">= <\/span>207<span style=\"color: gray\">)\r\n                    OR (<\/span>wait_type <span style=\"color: gray\">= <\/span>269<span style=\"color: gray\">)\r\n                    OR (<\/span>wait_type <span style=\"color: gray\">= <\/span>283<span style=\"color: gray\">)\r\n                    OR (<\/span>wait_type <span style=\"color: gray\">= <\/span>284<span style=\"color: gray\">)\r\n                )\r\n            )\r\n            OR \r\n            (<\/span>duration <span style=\"color: gray\">&gt; <\/span>30000        <span style=\"color: green\">-- Waits for locks that have exceeded 30 secs.\r\n                <\/span><span style=\"color: gray\">AND <\/span>wait_type <span style=\"color: gray\">&lt; <\/span>22\r\n            <span style=\"color: gray\">) \r\n        )\r\n    )\r\n),<\/span><\/pre>\n<\/blockquote>\n<p>Since Predicates perform short-circuit evaluation, where the criteria groups are evaluated in order and the first failure in the criteria causes the Predicate evaluation to stop and preventing the Event from being fired in the engine, the order of the criteria can directly impact the performance of an Event Session.&#160; If we look at the definition for the sqlos.wait_info Event, the first Predicate criteria specifies that the duration of the wait has to be greater than 15 seconds.&#160; Since the majority of waits in SQL Server generally occur with durations less than 15 seconds, the Predicate evaluations shortcut immediately and the Event does not fire.&#160; If the wait exceeds the 15 second duration, the evaluation continues and checks that the wait_type matches one of defined values.&#160; How do we know what these values are?&#160; <\/p>\n<p>When looking at an Event, all of the columns have a type_name associated with them that can be found in the sys.dm_xe_object_columns DMV as previously discussed in this series.&#160; If we take a look at the type_name for the wait_info Event wait_type column, we\u2019ll see that it has a type of wait_types.<\/p>\n<blockquote>\n<table width=\"690\">\n<tbody>\n<tr>\n<td width=\"320\">\n<pre class=\"code\"><span style=\"color: blue\">SELECT \r\n    <\/span>name<span style=\"color: gray\">, \r\n    <\/span><span style=\"color: magenta\">type_name<\/span><span style=\"color: gray\">, \r\n    <\/span>column_type\r\n<span style=\"color: blue\">FROM <\/span><span style=\"color: green\">sys<\/span><span style=\"color: gray\">.<\/span><span style=\"color: green\">dm_xe_object_columns\r\n<\/span><span style=\"color: blue\">WHERE <\/span><span style=\"color: magenta\">object_name <\/span><span style=\"color: gray\">= <\/span><span style=\"color: red\">'wait_info'\r\n  <\/span><span style=\"color: gray\">AND <\/span>column_type <span style=\"color: gray\">&lt;&gt; <\/span><span style=\"color: red\">'readonly'<\/span><\/pre>\n<\/td>\n<td width=\"368\"><a href=\"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windows-live-writer\/anxeventaday14of31acloserlookatpredicate\/469c8845\/image.png\"><img decoding=\"async\" style=\"border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windows-live-writer\/anxeventaday14of31acloserlookatpredicate\/6cfe6b90\/image_thumb.png\" width=\"244\" height=\"141\" \/><\/a> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/blockquote>\n<p>When a column has a non-standard type_name like this, it corresponds to a Map that has been loaded in Extended Events.&#160; We can find a list of the wait_types that the Event will fire for by querying the sys.dm_xe_map_values DMV for the map_keys defined in the Event Session:<\/p>\n<blockquote>\n<pre class=\"code\"><span style=\"color: blue\">SELECT <\/span>map_key<span style=\"color: gray\">, <\/span>map_value\r\n<span style=\"color: blue\">FROM <\/span><span style=\"color: green\">sys<\/span><span style=\"color: gray\">.<\/span><span style=\"color: green\">dm_xe_map_values\r\n<\/span><span style=\"color: blue\">WHERE <\/span>name <span style=\"color: gray\">= <\/span><span style=\"color: red\">'wait_types'\r\n  <\/span><span style=\"color: gray\">AND \r\n    (<\/span>map_key <span style=\"color: gray\">&gt; <\/span>31    <span style=\"color: green\">-- Waits for latches and important wait resources (not locks) \r\n                    -- that have exceeded 15 seconds. \r\n        <\/span><span style=\"color: gray\">AND\r\n        (\r\n            (<\/span>map_key <span style=\"color: gray\">&gt; <\/span>47 <span style=\"color: gray\">AND <\/span>map_key <span style=\"color: gray\">&lt; <\/span>54<span style=\"color: gray\">)\r\n            OR <\/span>map_key <span style=\"color: gray\">&lt; <\/span>38\r\n            <span style=\"color: gray\">OR (<\/span>map_key <span style=\"color: gray\">&gt; <\/span>63 <span style=\"color: gray\">AND <\/span>map_key <span style=\"color: gray\">&lt; <\/span>70<span style=\"color: gray\">)\r\n            OR (<\/span>map_key <span style=\"color: gray\">&gt; <\/span>96 <span style=\"color: gray\">AND <\/span>map_key <span style=\"color: gray\">&lt; <\/span>100<span style=\"color: gray\">)\r\n            OR (<\/span>map_key <span style=\"color: gray\">= <\/span>107<span style=\"color: gray\">)\r\n            OR (<\/span>map_key <span style=\"color: gray\">= <\/span>113<span style=\"color: gray\">)\r\n            OR (<\/span>map_key <span style=\"color: gray\">&gt; <\/span>174 <span style=\"color: gray\">AND <\/span>map_key <span style=\"color: gray\">&lt; <\/span>179<span style=\"color: gray\">)\r\n            OR (<\/span>map_key <span style=\"color: gray\">= <\/span>186<span style=\"color: gray\">)\r\n            OR (<\/span>map_key <span style=\"color: gray\">= <\/span>207<span style=\"color: gray\">)\r\n            OR (<\/span>map_key <span style=\"color: gray\">= <\/span>269<span style=\"color: gray\">)\r\n            OR (<\/span>map_key <span style=\"color: gray\">= <\/span>283<span style=\"color: gray\">)\r\n            OR (<\/span>map_key <span style=\"color: gray\">= <\/span>284<span style=\"color: gray\">)\r\n        )\r\n    )\r\n<\/span><\/pre>\n<\/blockquote>\n<p>The wait_types that correspond to the first complex grouping are: <\/p>\n<blockquote><p><center><\/p>\n<table width=\"634\">\n<tbody>\n<tr>\n<td width=\"300\">\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" width=\"300\">\n<tbody>\n<tr>\n<td width=\"10\">map_key<\/td>\n<td width=\"213\">map_value<\/td>\n<\/tr>\n<tr>\n<td width=\"10\">32<\/td>\n<td width=\"213\">LATCH_NL<\/td>\n<\/tr>\n<tr>\n<td width=\"10\">33<\/td>\n<td width=\"213\">LATCH_KP<\/td>\n<\/tr>\n<tr>\n<td width=\"10\">34<\/td>\n<td width=\"213\">LATCH_SH<\/td>\n<\/tr>\n<tr>\n<td width=\"10\">35<\/td>\n<td width=\"213\">LATCH_UP<\/td>\n<\/tr>\n<tr>\n<td width=\"10\">36<\/td>\n<td width=\"213\">LATCH_EX<\/td>\n<\/tr>\n<tr>\n<td width=\"10\">37<\/td>\n<td width=\"213\">LATCH_DT<\/td>\n<\/tr>\n<tr>\n<td width=\"10\">48<\/td>\n<td width=\"213\">PAGELATCH_NL<\/td>\n<\/tr>\n<tr>\n<td width=\"10\">49<\/td>\n<td width=\"213\">PAGELATCH_KP<\/td>\n<\/tr>\n<tr>\n<td width=\"10\">50<\/td>\n<td width=\"213\">PAGELATCH_SH<\/td>\n<\/tr>\n<tr>\n<td width=\"10\">51<\/td>\n<td width=\"213\">PAGELATCH_UP<\/td>\n<\/tr>\n<tr>\n<td width=\"10\">52<\/td>\n<td width=\"213\">PAGELATCH_EX<\/td>\n<\/tr>\n<tr>\n<td width=\"10\">53<\/td>\n<td width=\"213\">PAGELATCH_DT<\/td>\n<\/tr>\n<tr>\n<td width=\"10\">64<\/td>\n<td width=\"213\">PAGEIOLATCH_NL<\/td>\n<\/tr>\n<tr>\n<td width=\"10\">65<\/td>\n<td width=\"213\">PAGEIOLATCH_KP<\/td>\n<\/tr>\n<tr>\n<td width=\"10\">66<\/td>\n<td width=\"213\">PAGEIOLATCH_SH<\/td>\n<\/tr>\n<tr>\n<td width=\"10\">67<\/td>\n<td width=\"213\">PAGEIOLATCH_UP<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<td width=\"36\" ?50?=\"?50?\">&#160; <\/td>\n<td>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" width=\"300\">\n<tbody>\n<tr>\n<td width=\"67\">map_key<\/td>\n<td width=\"289\">map_value<\/td>\n<\/tr>\n<tr>\n<td width=\"67\">68<\/td>\n<td width=\"289\">PAGEIOLATCH_EX<\/td>\n<\/tr>\n<tr>\n<td width=\"67\">69<\/td>\n<td width=\"289\">PAGEIOLATCH_DT<\/td>\n<\/tr>\n<tr>\n<td width=\"67\">97<\/td>\n<td width=\"289\">IO_COMPLETION<\/td>\n<\/tr>\n<tr>\n<td width=\"67\">98<\/td>\n<td width=\"289\">ASYNC_IO_COMPLETION<\/td>\n<\/tr>\n<tr>\n<td width=\"67\">99<\/td>\n<td width=\"289\">NETWORK_IO<\/td>\n<\/tr>\n<tr>\n<td width=\"67\">107<\/td>\n<td width=\"289\">RESOURCE_SEMAPHORE<\/td>\n<\/tr>\n<tr>\n<td width=\"67\">113<\/td>\n<td width=\"289\">SOS_WORKER<\/td>\n<\/tr>\n<tr>\n<td width=\"67\">175<\/td>\n<td width=\"289\">FCB_REPLICA_WRITE<\/td>\n<\/tr>\n<tr>\n<td width=\"67\">176<\/td>\n<td width=\"289\">FCB_REPLICA_READ<\/td>\n<\/tr>\n<tr>\n<td width=\"67\">177<\/td>\n<td width=\"289\">HOLDER11<\/td>\n<\/tr>\n<tr>\n<td width=\"67\">178<\/td>\n<td width=\"289\">WRITELOG<\/td>\n<\/tr>\n<tr>\n<td width=\"67\">186<\/td>\n<td width=\"289\">CMEMTHREAD<\/td>\n<\/tr>\n<tr>\n<td width=\"67\">207<\/td>\n<td width=\"289\">TRACEWRITE<\/td>\n<\/tr>\n<tr>\n<td width=\"67\">269<\/td>\n<td width=\"289\">RESOURCE_SEMAPHORE_MUTEX<\/td>\n<\/tr>\n<tr>\n<td width=\"67\">283<\/td>\n<td width=\"289\">RESOURCE_SEMAPHORE_QUERY_COMPILE<\/td>\n<\/tr>\n<tr>\n<td width=\"67\">284<\/td>\n<td width=\"289\">RESOURCE_SEMAPHORE_SMALL_QUERY<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>  <\/center><\/p><\/blockquote>\n<p>If you look at the way the Predicate is defined, it is much closer to how you\u2019d write a WHERE clause with complex filtering criteria, allowing groups of specific criteria to be defined within sets of parenthesis\u2019s that are evaluated together, something that was impossible with SQL Trace.<\/p>\n<p>In addition to being able to define Predicates based on the Event columns returned by an Event, it is possible to also define Predicates on the global state data available in the Extended Events Engine.&#160; If you\u2019ll recall, the global state predicates are available in the sys.dm_xe_objects DMV as pred_source object_type\u2019s.<\/p>\n<blockquote><p><center><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<div align=\"left\">\n<pre class=\"code\"><span style=\"color: blue\">SELECT \r\n    <\/span>p<span style=\"color: gray\">.<\/span>name <span style=\"color: blue\">AS <\/span>package_name<span style=\"color: gray\">,\r\n    <\/span>o<span style=\"color: gray\">.<\/span>name <span style=\"color: blue\">AS <\/span>predicate_name<span style=\"color: gray\">,\r\n    <\/span>o<span style=\"color: gray\">.<\/span><span style=\"color: blue\">description\r\nFROM <\/span><span style=\"color: green\">sys<\/span><span style=\"color: gray\">.<\/span><span style=\"color: green\">dm_xe_packages <\/span><span style=\"color: blue\">AS <\/span>p\r\n<span style=\"color: gray\">INNER JOIN <\/span><span style=\"color: green\">sys<\/span><span style=\"color: gray\">.<\/span><span style=\"color: green\">dm_xe_objects <\/span><span style=\"color: blue\">AS <\/span>o\r\n    <span style=\"color: blue\">ON <\/span>p<span style=\"color: gray\">.<\/span><span style=\"color: blue\">guid <\/span><span style=\"color: gray\">= <\/span>o<span style=\"color: gray\">.<\/span>package_guid\r\n<span style=\"color: blue\">WHERE <\/span><span style=\"color: gray\">(<\/span>p<span style=\"color: gray\">.<\/span>capabilities <span style=\"color: gray\">IS NULL OR <\/span>p<span style=\"color: gray\">.<\/span>capabilities <span style=\"color: gray\">&amp; <\/span>1 <span style=\"color: gray\">= <\/span>0<span style=\"color: gray\">)\r\n  AND <\/span>o<span style=\"color: gray\">.<\/span>object_type <span style=\"color: gray\">= <\/span><span style=\"color: red\">'pred_source'<\/span><\/pre>\n<\/p><\/div>\n<\/td>\n<td width=\"23\">&#160;<\/td>\n<td width=\"16\"><a href=\"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windows-live-writer\/anxeventaday14of31acloserlookatpredicate\/330f28a4\/image.png\"><img decoding=\"async\" style=\"border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windows-live-writer\/anxeventaday14of31acloserlookatpredicate\/003f2230\/image_thumb.png\" width=\"244\" height=\"135\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>  <\/center><\/p><\/blockquote>\n<p>Two of the predicate sources are special, the package0.counter and package0.partitioned_counter, and can be used to restrict the number of occurrences of an Events that are captured by an Event Session.&#160; The following demonstration creates an Event Session that captures the first five occurrences of the sqlserver.sql_statement_completed Event, and then executes six statements in sequence.&#160; When the target_data is queried the last statement SELECT @@SPID is not included in the results.<\/p>\n<blockquote>\n<pre class=\"code\"><span style=\"color: blue\">CREATE EVENT SESSION <\/span>CounterPredicateDemo\r\n<span style=\"color: blue\">ON SERVER\r\nADD EVENT <\/span>sqlserver<span style=\"color: gray\">.<\/span>sql_statement_completed\r\n<span style=\"color: gray\">( <\/span><span style=\"color: blue\">ACTION <\/span><span style=\"color: gray\">(<\/span>sqlserver<span style=\"color: gray\">.<\/span>sql_text<span style=\"color: gray\">)\r\n  <\/span><span style=\"color: blue\">WHERE <\/span><span style=\"color: gray\">(<\/span>package0<span style=\"color: gray\">.<\/span><span style=\"color: blue\">counter <\/span><span style=\"color: gray\">&lt;=<\/span>5<span style=\"color: gray\">))\r\n<\/span><span style=\"color: blue\">ADD TARGET <\/span>package0<span style=\"color: gray\">.<\/span>ring_buffer\r\n<span style=\"color: blue\">WITH <\/span><span style=\"color: gray\">(<\/span>MAX_DISPATCH_LATENCY <span style=\"color: gray\">= <\/span>1 SECONDS<span style=\"color: gray\">)\r\n<\/span><span style=\"color: blue\">GO\r\nALTER EVENT SESSION <\/span>CounterPredicateDemo\r\n<span style=\"color: blue\">ON SERVER\r\nSTATE <\/span><span style=\"color: gray\">= <\/span>START\r\n<span style=\"color: blue\">GO\r\nSELECT <\/span><span style=\"color: magenta\">@@VERSION\r\n<\/span><span style=\"color: blue\">GO\r\nSELECT <\/span><span style=\"color: magenta\">@@SERVERNAME\r\n<\/span><span style=\"color: blue\">GO\r\nSELECT <\/span><span style=\"color: magenta\">@@SPID\r\n<\/span><span style=\"color: blue\">GO\r\nSELECT <\/span><span style=\"color: magenta\">@@VERSION\r\n<\/span><span style=\"color: blue\">GO\r\nSELECT <\/span><span style=\"color: magenta\">@@SERVERNAME\r\n<\/span><span style=\"color: blue\">GO\r\nSELECT <\/span><span style=\"color: magenta\">@@SPID\r\n<\/span><span style=\"color: blue\">GO\r\nALTER EVENT SESSION <\/span>CounterPredicateDemo\r\n<span style=\"color: blue\">ON SERVER\r\nDROP EVENT <\/span>sqlserver<span style=\"color: gray\">.<\/span>sql_statement_completed\r\n<span style=\"color: blue\">GO\r\n<\/span><span style=\"color: green\">-- Wait in a delay for Events to Buffer\r\n<\/span><span style=\"color: blue\">WAITFOR DELAY <\/span><span style=\"color: red\">'00:00:05'\r\n<\/span><span style=\"color: blue\">GO\r\n\r\n<\/span><span style=\"color: green\">-- Query the XML to get the Target Data\r\n<\/span><span style=\"color: blue\">SELECT \r\n    <\/span>n<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/@name)[1]'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'varchar(50)'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>event_name<span style=\"color: gray\">,\r\n    <\/span>n<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/@package)[1]'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'varchar(50)'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>package_name<span style=\"color: gray\">,\r\n    <\/span><span style=\"color: magenta\">DATEADD<\/span><span style=\"color: gray\">(<\/span>hh<span style=\"color: gray\">, \r\n            <\/span><span style=\"color: magenta\">DATEDIFF<\/span><span style=\"color: gray\">(<\/span>hh<span style=\"color: gray\">, <\/span><span style=\"color: magenta\">GETUTCDATE<\/span><span style=\"color: gray\">(), <\/span><span style=\"color: magenta\">CURRENT_TIMESTAMP<\/span><span style=\"color: gray\">), \r\n            <\/span>n<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/@timestamp)[1]'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'datetime2'<\/span><span style=\"color: gray\">)) <\/span><span style=\"color: blue\">AS <\/span>[timestamp]<span style=\"color: gray\">,  \r\n    <\/span>n<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/data[@name=&quot;object_id&quot;]\/value)[1]'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'int'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>[object_id]<span style=\"color: gray\">,\r\n    <\/span>n<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/data[@name=&quot;object_type&quot;]\/value)[1]'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'nvarchar(128)'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>[object_type]<span style=\"color: gray\">,\r\n    <\/span>n<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/data[@name=&quot;duration&quot;]\/value)[1]'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'int'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>[duration]<span style=\"color: gray\">,\r\n    <\/span>n<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/data[@name=&quot;cpu&quot;]\/value)[1]'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'int'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>[cpu]<span style=\"color: gray\">,\r\n    <\/span>n<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/data[@name=&quot;reads&quot;]\/value)[1]'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'int'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>[reads]<span style=\"color: gray\">,\r\n    <\/span>n<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/data[@name=&quot;writes&quot;]\/value)[1]'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'int'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>[writes]<span style=\"color: gray\">,\r\n    <\/span>n<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/action[@name=&quot;sql_text&quot;]\/value)[1]'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'nvarchar(max)'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>[sql_text]\r\n<span style=\"color: blue\">FROM\r\n<\/span><span style=\"color: gray\">(    <\/span><span style=\"color: blue\">SELECT <\/span>td<span style=\"color: gray\">.<\/span>query<span style=\"color: gray\">(<\/span><span style=\"color: red\">'.'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">as <\/span>n\r\n    <span style=\"color: blue\">FROM \r\n    <\/span><span style=\"color: gray\">(\r\n        <\/span><span style=\"color: blue\">SELECT <\/span><span style=\"color: magenta\">CAST<\/span><span style=\"color: gray\">(<\/span>target_data <span style=\"color: blue\">AS XML<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">as <\/span>target_data\r\n        <span style=\"color: blue\">FROM <\/span><span style=\"color: green\">sys<\/span><span style=\"color: gray\">.<\/span><span style=\"color: green\">dm_xe_sessions <\/span><span style=\"color: blue\">AS <\/span>s \r\n        <span style=\"color: gray\">JOIN <\/span><span style=\"color: green\">sys<\/span><span style=\"color: gray\">.<\/span><span style=\"color: green\">dm_xe_session_targets <\/span><span style=\"color: blue\">AS <\/span>t \r\n            <span style=\"color: blue\">ON <\/span>t<span style=\"color: gray\">.<\/span>event_session_address <span style=\"color: gray\">= <\/span>s<span style=\"color: gray\">.<\/span><span style=\"color: blue\">address\r\n        WHERE <\/span>s<span style=\"color: gray\">.<\/span>name <span style=\"color: gray\">= <\/span><span style=\"color: red\">'CounterPredicateDemo'\r\n          <\/span><span style=\"color: gray\">AND <\/span>t<span style=\"color: gray\">.<\/span>target_name <span style=\"color: gray\">= <\/span><span style=\"color: red\">'ring_buffer'\r\n    <\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>sub\r\n    <span style=\"color: gray\">CROSS APPLY <\/span>target_data<span style=\"color: gray\">.<\/span>nodes<span style=\"color: gray\">(<\/span><span style=\"color: red\">'RingBufferTarget\/event'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>q<span style=\"color: gray\">(<\/span>td<span style=\"color: gray\">)\r\n) <\/span><span style=\"color: blue\">as <\/span>tab\r\n<span style=\"color: blue\">GO\r\n<\/span><span style=\"color: green\">-- Drop the Event Session\r\n<\/span><span style=\"color: blue\">DROP EVENT SESSION <\/span>CounterPredicateDemo\r\n<span style=\"color: blue\">ON SERVER<\/span><\/pre>\n<\/blockquote>\n<blockquote>\n<p><a href=\"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windows-live-writer\/anxeventaday14of31acloserlookatpredicate\/4a5a2d15\/image.png\"><img fetchpriority=\"high\" decoding=\"async\" style=\"border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windows-live-writer\/anxeventaday14of31acloserlookatpredicate\/5034d0ae\/image_thumb.png\" width=\"644\" height=\"89\" \/><\/a> <\/p>\n<\/blockquote>\n<p>This capabilities behind Predicate definition in Extended Events makes it much more flexible, and powerful for troubleshooting than SQL Trace.&#160; It also makes Extended Events much more performant than Trace by preempting Event firing for Events that are not of interest.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When working with SQL Trace, one of my biggest frustrations has been the limitations that exist in filtering.&#160; Using sp_trace_setfilter to establish the filter criteria is a non-trivial task, and it falls short of being able to deliver complex filtering that is sometimes needed to simplify analysis.&#160; Filtering of trace data was performed globally and [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,38,40,45],"tags":[],"class_list":["post-550","post","type-post","status-publish","format-standard","hentry","category-extended-events","category-sql-server-2008","category-sql-server-denali","category-xevent-a-day-series"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>An XEvent a Day (14 of 31) \u2013 A Closer Look at Predicates - Jonathan Kehayias<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"An XEvent a Day (14 of 31) \u2013 A Closer Look at Predicates - Jonathan Kehayias\" \/>\n<meta property=\"og:description\" content=\"When working with SQL Trace, one of my biggest frustrations has been the limitations that exist in filtering.&#160; Using sp_trace_setfilter to establish the filter criteria is a non-trivial task, and it falls short of being able to deliver complex filtering that is sometimes needed to simplify analysis.&#160; Filtering of trace data was performed globally and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\/\" \/>\n<meta property=\"og:site_name\" content=\"Jonathan Kehayias\" \/>\n<meta property=\"article:published_time\" content=\"2010-12-14T20:40:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-04-13T16:16:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windows-live-writer\/anxeventaday14of31acloserlookatpredicate\/6cfe6b90\/image_thumb.png\" \/>\n<meta name=\"author\" content=\"Jonathan Kehayias\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jonathan Kehayias\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\\\/\"},\"author\":{\"name\":\"Jonathan Kehayias\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/#\\\/schema\\\/person\\\/01c10d94f3648654ef706d5e6305f69c\"},\"headline\":\"An XEvent a Day (14 of 31) \u2013 A Closer Look at Predicates\",\"datePublished\":\"2010-12-14T20:40:00+00:00\",\"dateModified\":\"2017-04-13T16:16:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\\\/\"},\"wordCount\":749,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.SQLskills.com\\\/blogs\\\/jonathan\\\/wp-content\\\/uploads\\\/windows-live-writer\\\/anxeventaday14of31acloserlookatpredicate\\\/6cfe6b90\\\/image_thumb.png\",\"articleSection\":[\"Extended Events\",\"SQL Server 2008\",\"SQL Server Denali\",\"XEvent a Day Series\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\\\/\",\"url\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\\\/\",\"name\":\"An XEvent a Day (14 of 31) \u2013 A Closer Look at Predicates - Jonathan Kehayias\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.SQLskills.com\\\/blogs\\\/jonathan\\\/wp-content\\\/uploads\\\/windows-live-writer\\\/anxeventaday14of31acloserlookatpredicate\\\/6cfe6b90\\\/image_thumb.png\",\"datePublished\":\"2010-12-14T20:40:00+00:00\",\"dateModified\":\"2017-04-13T16:16:42+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/#\\\/schema\\\/person\\\/01c10d94f3648654ef706d5e6305f69c\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.SQLskills.com\\\/blogs\\\/jonathan\\\/wp-content\\\/uploads\\\/windows-live-writer\\\/anxeventaday14of31acloserlookatpredicate\\\/6cfe6b90\\\/image_thumb.png\",\"contentUrl\":\"https:\\\/\\\/www.SQLskills.com\\\/blogs\\\/jonathan\\\/wp-content\\\/uploads\\\/windows-live-writer\\\/anxeventaday14of31acloserlookatpredicate\\\/6cfe6b90\\\/image_thumb.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Extended Events\",\"item\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/category\\\/extended-events\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"An XEvent a Day (14 of 31) \u2013 A Closer Look at Predicates\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/#website\",\"url\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/\",\"name\":\"Jonathan Kehayias - The Rambling DBA\",\"description\":\"The Rambling DBA\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/#\\\/schema\\\/person\\\/01c10d94f3648654ef706d5e6305f69c\",\"name\":\"Jonathan Kehayias\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/86630e27f5deecc5c393ea57fc7c3b6a068949f4fd6b5309f81de5a276f12855?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/86630e27f5deecc5c393ea57fc7c3b6a068949f4fd6b5309f81de5a276f12855?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/86630e27f5deecc5c393ea57fc7c3b6a068949f4fd6b5309f81de5a276f12855?s=96&d=mm&r=g\",\"caption\":\"Jonathan Kehayias\"},\"sameAs\":[\"http:\\\/\\\/3.209.169.194\\\/blogs\\\/jonathan\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"An XEvent a Day (14 of 31) \u2013 A Closer Look at Predicates - Jonathan Kehayias","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\/","og_locale":"en_US","og_type":"article","og_title":"An XEvent a Day (14 of 31) \u2013 A Closer Look at Predicates - Jonathan Kehayias","og_description":"When working with SQL Trace, one of my biggest frustrations has been the limitations that exist in filtering.&#160; Using sp_trace_setfilter to establish the filter criteria is a non-trivial task, and it falls short of being able to deliver complex filtering that is sometimes needed to simplify analysis.&#160; Filtering of trace data was performed globally and [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\/","og_site_name":"Jonathan Kehayias","article_published_time":"2010-12-14T20:40:00+00:00","article_modified_time":"2017-04-13T16:16:42+00:00","og_image":[{"url":"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windows-live-writer\/anxeventaday14of31acloserlookatpredicate\/6cfe6b90\/image_thumb.png","type":"","width":"","height":""}],"author":"Jonathan Kehayias","twitter_misc":{"Written by":"Jonathan Kehayias","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\/#article","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\/"},"author":{"name":"Jonathan Kehayias","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/#\/schema\/person\/01c10d94f3648654ef706d5e6305f69c"},"headline":"An XEvent a Day (14 of 31) \u2013 A Closer Look at Predicates","datePublished":"2010-12-14T20:40:00+00:00","dateModified":"2017-04-13T16:16:42+00:00","mainEntityOfPage":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\/"},"wordCount":749,"commentCount":0,"image":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\/#primaryimage"},"thumbnailUrl":"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windows-live-writer\/anxeventaday14of31acloserlookatpredicate\/6cfe6b90\/image_thumb.png","articleSection":["Extended Events","SQL Server 2008","SQL Server Denali","XEvent a Day Series"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\/","url":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\/","name":"An XEvent a Day (14 of 31) \u2013 A Closer Look at Predicates - Jonathan Kehayias","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\/#primaryimage"},"image":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\/#primaryimage"},"thumbnailUrl":"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windows-live-writer\/anxeventaday14of31acloserlookatpredicate\/6cfe6b90\/image_thumb.png","datePublished":"2010-12-14T20:40:00+00:00","dateModified":"2017-04-13T16:16:42+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/#\/schema\/person\/01c10d94f3648654ef706d5e6305f69c"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\/#primaryimage","url":"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windows-live-writer\/anxeventaday14of31acloserlookatpredicate\/6cfe6b90\/image_thumb.png","contentUrl":"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windows-live-writer\/anxeventaday14of31acloserlookatpredicate\/6cfe6b90\/image_thumb.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-14-of-31-a-closer-look-at-predicates\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/"},{"@type":"ListItem","position":2,"name":"Extended Events","item":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/category\/extended-events\/"},{"@type":"ListItem","position":3,"name":"An XEvent a Day (14 of 31) \u2013 A Closer Look at Predicates"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/","name":"Jonathan Kehayias - The Rambling DBA","description":"The Rambling DBA","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/#\/schema\/person\/01c10d94f3648654ef706d5e6305f69c","name":"Jonathan Kehayias","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/86630e27f5deecc5c393ea57fc7c3b6a068949f4fd6b5309f81de5a276f12855?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/86630e27f5deecc5c393ea57fc7c3b6a068949f4fd6b5309f81de5a276f12855?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/86630e27f5deecc5c393ea57fc7c3b6a068949f4fd6b5309f81de5a276f12855?s=96&d=mm&r=g","caption":"Jonathan Kehayias"},"sameAs":["http:\/\/3.209.169.194\/blogs\/jonathan"]}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/posts\/550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/comments?post=550"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/posts\/550\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/media?parent=550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/categories?post=550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/tags?post=550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}