{"id":534,"date":"2010-12-30T23:00:00","date_gmt":"2010-12-30T23:00:00","guid":{"rendered":"\/blogs\/jonathan\/post\/An-XEvent-a-Day-(30-of-31)-e28093-Tracking-Session-and-Statement-Level-Waits.aspx"},"modified":"2017-04-13T14:41:51","modified_gmt":"2017-04-13T18:41:51","slug":"an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\/","title":{"rendered":"An XEvent a Day (30 of 31) \u2013 Tracking Session and Statement Level Waits"},"content":{"rendered":"<p>While attending PASS Summit this year, I got the opportunity to hang out with Brent Ozar (<a href=\"https:\/\/www.brentozar.com\/\" target=\"_blank\">Blog<\/a>|<a href=\"https:\/\/mobile.twitter.com\/BrentO\" target=\"_blank\">Twitter<\/a>) one afternoon while he did some work for Yanni Robel (<a href=\"http:\/\/yannirobel.com\/\" target=\"_blank\">Blog<\/a>|<a href=\"https:\/\/twitter.com\/YanniRobel\" target=\"_blank\">Twitter<\/a>).&#160; After looking at the wait stats information, Brent pointed out some potential problem points, and based on that information I pulled up my code for my PASS session the next day on Wait Statistics and Extended Events and made some changes to one of the demo\u2019s so that the Event Session only focused on those potentially problematic waits that had been identified, and sent Brent the DDL so that he could give Extended Events a shot.&#160; Within a few minutes, we were able track down to the statement level in a couple of stored procedures, the causes of those waits, and after some analysis Brent was able to offer some suggestions to Yanni about how to reduce the waits.<\/p>\n<p>Understanding how SQL Server waits to continue execution can be key to improving performance since time spent waiting is time lost during the execution of a SQL Statement.&#160; I love looking at wait statistics and the chapter that I wrote for <a href=\"https:\/\/www.amazon.com\/Professional-Server-2008-Internals-Troubleshooting\/dp\/0470484284\/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1293754853&amp;sr=8-1\" target=\"_blank\">SQL Server 2008 Internals and Troubleshooting<\/a> was SQL Server Waits and Extended Events.&#160; Information about wait statistics has been available in SQL Server for a long time, and many of the vendors that develop monitoring applications for SQL Server have polling methods that query sys.dm_os_waiting_tasks or sys.sysprocesses to capture wait information about the tasks that are currently active in the system.&#160; However one of the shortcomings of a polling method is that it misses a lot of the wait information because it is a point in time snapshot only.&#160; If the polling interval is every second, only the active waits that exist at that second are captured, and any waits that occur between the polling interval is missed.&#160; This information is still accumulated in sys.dm_os_wait_stats, but it is impossible to track it back to the statement level from that DMV.<\/p>\n<p>Extended Events offers us the ability to capture information about waits without missing any of the information.&#160; Already in this series we\u2019ve seen how to use Extended Events with the <a href=\"http:\/\/sqlblog.com\/blogs\/jonathan_kehayias\/archive\/2010\/12\/07\/An-XEvent-a-Day-_2800_7-of-31_2900_-_2D00_-Targets-Week-_2D00_-Bucketizers.aspx\" target=\"_blank\">Bucketizer Target<\/a> to count the occurrences of waits by type.&#160; This isn\u2019t really a great use of Extended Events since sys.dm_os_wait_stats counts the occurrences of the wait types already, and a differential analysis of the information contained in sys.dm_os_wait_stats can provide this information.&#160; The purpose of that example was to discuss the bug that existed in the RTM release of SQL Server 2008 more than it was to provide a sensible use for the target.&#160; However, if we wanted to break our waits down by database, we could bucket on the database_id, and begin to understand which database had the most waits associated with it, but not by the individual wait type.&#160; To get to that level of information, we need to collect all of the waits and the associated information for them to do further analysis.<\/p>\n<p>There are two Events in Extended Events associated with wait types; sqlos.wait_info and sqlos.wait_info_external.&#160; Looking at the description of the Events in the Metadata DMV\u2019s we can get an idea of when each Event will fire. <\/p>\n<blockquote>\n<pre class=\"code\"><span style=\"color: blue\">SELECT <\/span>name<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_objects\r\n<\/span><span style=\"color: blue\">WHERE <\/span>name <span style=\"color: gray\">LIKE <\/span><span style=\"color: red\">'wait_info%'<\/span><\/pre>\n<\/blockquote>\n<p><a href=\"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windows-live-writer\/anxeventaday30of31capturingsessionstatem\/36de3d12\/image.png\" target=\"_blank\"><img decoding=\"async\" style=\"border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windows-live-writer\/anxeventaday30of31capturingsessionstatem\/412f6172\/image_thumb.png\" width=\"788\" height=\"63\" \/><\/a> <\/p>\n<p>The sqlos.wait_info_external Event will fire for wait types that begin with PREEMPTIVE_ in the name, and the sqlos.wait_info Event will fire for the other wait types that occur on the server.&#160; Glenn Alan Berry (<a href=\"https:\/\/sqlserverperformance.wordpress.com\/\" target=\"_blank\">Blog<\/a>|<a href=\"https:\/\/twitter.com\/glennalanberry\" target=\"_blank\">Twitter<\/a>) has a great script that filters queries sys.dm_os_wait_stats and filters out common waits that are not generally problematic.&#160; You can find his script on his blog post <a href=\"https:\/\/sqlserverperformance.wordpress.com\/2010\/12\/29\/updated-sql-2005-and-2008-diagnostic-queries\/\">Updated SQL 2005 and 2008 Diagnostic Queries<\/a>.&#160; You can use this script to identify the most common waits on a server, and then use that information to build an Event Session that captures the session and statement information for those individual wait types.&#160; In SQL Server 2008, there are 484 wait types listed in sys.dm_os_wait_stats and there are 599 map_value\u2019s for the wait_types Map in sys.dm_xe_map_values.&#160; The reason this is different is that the Map was created from the header file for the wait types and there are padded values that exist in the Map that don\u2019t really correspond to wait types that exist in SQL Server.&#160; However, there are also a couple of Maps for the wait_types that don\u2019t match the wait type in sys.dm_os_wait_stats, the most notable being the ASYNC_NETWORK_IO to NETWORK_IO.<\/p>\n<p>To build the Event Session, we just need to query sys.dm_map_values for our wait_types and use the map_key&#8217;s in the Predicate definition of the sqlos.wait_info or sqlos.wait_info_external Event as appropriate.&#160; We can also do the same thing to build a generic Event Session that tracks the most common resource related waits.<\/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 ((<\/span>map_key <span style=\"color: gray\">&gt; <\/span>0 <span style=\"color: gray\">AND <\/span>map_key <span style=\"color: gray\">&lt; <\/span>22<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- LCK_ waits\r\n            <\/span><span style=\"color: gray\">OR (<\/span>map_key <span style=\"color: gray\">&gt; <\/span>31 <span style=\"color: gray\">AND <\/span>map_key <span style=\"color: gray\">&lt; <\/span>38<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- LATCH_ waits\r\n            <\/span><span style=\"color: gray\">OR (<\/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\">) <\/span><span style=\"color: green\">-- PAGELATCH_ waits\r\n            <\/span><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\">) <\/span><span style=\"color: green\">-- PAGEIOLATCH_ waits\r\n            <\/span><span style=\"color: gray\">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\">) <\/span><span style=\"color: green\">-- IO (Disk\/Network) waits\r\n            <\/span><span style=\"color: gray\">OR (<\/span>map_key <span style=\"color: gray\">= <\/span>107<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- RESOURCE_SEMAPHORE waits\r\n            <\/span><span style=\"color: gray\">OR (<\/span>map_key <span style=\"color: gray\">= <\/span>113<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- SOS_WORKER waits\r\n            <\/span><span style=\"color: gray\">OR (<\/span>map_key <span style=\"color: gray\">= <\/span>120<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- SOS_SCHEDULER_YIELD waits\r\n            <\/span><span style=\"color: gray\">OR (<\/span>map_key <span style=\"color: gray\">= <\/span>178<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- WRITELOG waits\r\n            <\/span><span style=\"color: gray\">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>177<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- FCB_REPLICA_ waits\r\n            <\/span><span style=\"color: gray\">OR (<\/span>map_key <span style=\"color: gray\">= <\/span>186<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- CMEMTHREAD waits\r\n            <\/span><span style=\"color: gray\">OR (<\/span>map_key <span style=\"color: gray\">= <\/span>187<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- CXPACKET waits\r\n            <\/span><span style=\"color: gray\">OR (<\/span>map_key <span style=\"color: gray\">= <\/span>207<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- TRACEWRITE waits\r\n            <\/span><span style=\"color: gray\">OR (<\/span>map_key <span style=\"color: gray\">= <\/span>269<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- RESOURCE_SEMAPHORE_MUTEX waits\r\n            <\/span><span style=\"color: gray\">OR (<\/span>map_key <span style=\"color: gray\">= <\/span>283<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- RESOURCE_SEMAPHORE_QUERY_COMPILE waits\r\n            <\/span><span style=\"color: gray\">OR (<\/span>map_key <span style=\"color: gray\">= <\/span>284<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- RESOURCE_SEMAPHORE_SMALL_QUERY waits\r\n        <\/span><span style=\"color: gray\">)<\/span><\/pre>\n<\/blockquote>\n<p>Once we have the list of map_key\u2019s defined, we can do a replace in SSMS and change map_key to wait_type and define the predicate for the sqlos.wait_info Event for our Event Session.<\/p>\n<blockquote>\n<pre class=\"code\"><span style=\"color: blue\">CREATE EVENT SESSION <\/span><span style=\"color: teal\">[TrackResourceWaits] <\/span><span style=\"color: blue\">ON SERVER \r\nADD EVENT  <\/span><span style=\"color: teal\">sqlos<\/span><span style=\"color: gray\">.<\/span><span style=\"color: teal\">wait_info\r\n<\/span><span style=\"color: gray\">(    <\/span><span style=\"color: green\">-- Capture the database_id, session_id, plan_handle, and sql_text\r\n    <\/span><span style=\"color: blue\">ACTION<\/span><span style=\"color: gray\">(<\/span><span style=\"color: teal\">sqlserver<\/span><span style=\"color: gray\">.<\/span><span style=\"color: teal\">database_id<\/span><span style=\"color: gray\">,<\/span><span style=\"color: teal\">sqlserver<\/span><span style=\"color: gray\">.<\/span><span style=\"color: teal\">session_id<\/span><span style=\"color: gray\">,<\/span><span style=\"color: teal\">sqlserver<\/span><span style=\"color: gray\">.<\/span><span style=\"color: teal\">sql_text<\/span><span style=\"color: gray\">,<\/span><span style=\"color: teal\">sqlserver<\/span><span style=\"color: gray\">.<\/span><span style=\"color: teal\">plan_handle<\/span><span style=\"color: gray\">)\r\n    <\/span><span style=\"color: blue\">WHERE\r\n        <\/span><span style=\"color: gray\">(<\/span><span style=\"color: teal\">opcode <\/span><span style=\"color: gray\">= <\/span>1 <span style=\"color: green\">--End Events Only\r\n            <\/span><span style=\"color: gray\">AND <\/span><span style=\"color: teal\">duration <\/span><span style=\"color: gray\">&gt; 10<\/span>0 <span style=\"color: green\">-- had to accumulate 100ms of time\r\n            <\/span><span style=\"color: gray\">AND ((<\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">&gt; <\/span>0 <span style=\"color: gray\">AND <\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">&lt; <\/span>22<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- LCK_ waits\r\n                    <\/span><span style=\"color: gray\">OR (<\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">&gt; <\/span>31 <span style=\"color: gray\">AND <\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">&lt; <\/span>38<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- LATCH_ waits\r\n                    <\/span><span style=\"color: gray\">OR (<\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">&gt; <\/span>47 <span style=\"color: gray\">AND <\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">&lt; <\/span>54<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- PAGELATCH_ waits\r\n                    <\/span><span style=\"color: gray\">OR (<\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">&gt; <\/span>63 <span style=\"color: gray\">AND <\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">&lt; <\/span>70<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- PAGEIOLATCH_ waits\r\n                    <\/span><span style=\"color: gray\">OR (<\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">&gt; <\/span>96 <span style=\"color: gray\">AND <\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">&lt; <\/span>100<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- IO (Disk\/Network) waits\r\n                    <\/span><span style=\"color: gray\">OR (<\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">= <\/span>107<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- RESOURCE_SEMAPHORE waits\r\n                    <\/span><span style=\"color: gray\">OR (<\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">= <\/span>113<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- SOS_WORKER waits\r\n                    <\/span><span style=\"color: gray\">OR (<\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">= <\/span>120<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- SOS_SCHEDULER_YIELD waits\r\n                    <\/span><span style=\"color: gray\">OR (<\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">= <\/span>178<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- WRITELOG waits\r\n                    <\/span><span style=\"color: gray\">OR (<\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">&gt; <\/span>174 <span style=\"color: gray\">AND <\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">&lt; <\/span>177<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- FCB_REPLICA_ waits\r\n                    <\/span><span style=\"color: gray\">OR (<\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">= <\/span>186<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- CMEMTHREAD waits\r\n                    <\/span><span style=\"color: gray\">OR (<\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">= <\/span>187<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- CXPACKET waits\r\n                    <\/span><span style=\"color: gray\">OR (<\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">= <\/span>207<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- TRACEWRITE waits\r\n                    <\/span><span style=\"color: gray\">OR (<\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">= <\/span>269<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- RESOURCE_SEMAPHORE_MUTEX waits\r\n                    <\/span><span style=\"color: gray\">OR (<\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">= <\/span>283<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- RESOURCE_SEMAPHORE_QUERY_COMPILE waits\r\n                    <\/span><span style=\"color: gray\">OR (<\/span><span style=\"color: teal\">wait_type <\/span><span style=\"color: gray\">= <\/span>284<span style=\"color: gray\">) <\/span><span style=\"color: green\">-- RESOURCE_SEMAPHORE_SMALL_QUERY waits\r\n                <\/span><span style=\"color: gray\">)\r\n        )\r\n)\r\n<\/span><span style=\"color: blue\">ADD TARGET <\/span><span style=\"color: teal\">package0<\/span><span style=\"color: gray\">.<\/span><span style=\"color: teal\">ring_buffer<\/span><span style=\"color: gray\">(<\/span><span style=\"color: blue\">SET <\/span><span style=\"color: teal\">max_memory<\/span><span style=\"color: gray\">=<\/span>4096<span style=\"color: gray\">)\r\n<\/span><span style=\"color: blue\">WITH <\/span><span style=\"color: gray\">(<\/span><span style=\"color: teal\">EVENT_RETENTION_MODE<\/span><span style=\"color: gray\">=<\/span><span style=\"color: teal\">ALLOW_SINGLE_EVENT_LOSS<\/span><span style=\"color: gray\">,\r\n      <\/span><span style=\"color: teal\">MAX_DISPATCH_LATENCY<\/span><span style=\"color: gray\">=<\/span>5 <span style=\"color: teal\">SECONDS<\/span><span style=\"color: gray\">)\r\n<\/span><span style=\"color: blue\">GO\r\n<\/span><\/pre>\n<\/blockquote>\n<p>&#160;<\/p>\n<p>Now that we have the Event Session defined, we can start it as needed to collect the resource wait information for our system.&#160; The only concern with this Event Session is the Target being used.&#160; If the Event Session is going to run for a long period of time, or if the waits on the server being monitored occur in large quantities, the Target should be changed away from the ring_buffer to the asynchronous_file_target.&#160; I configured this session to only collect waits that exceed 100ms in duration.&#160; If you want waits that have shorter durations this can easily be changed.&#160; If you set the duration to be &gt; 0 a lot of 1-5ms waits will be collected that aren\u2019t generally interesting.&#160; To query the wait information from this Event Session using the ring_buffer:<\/p>\n<blockquote>\n<pre class=\"code\"><span style=\"color: green\">-- Extract the Event information from the Event Session \r\n<\/span><span style=\"color: blue\">SELECT \r\n    <\/span>event_data<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><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>event_data<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><span style=\"color: magenta\">COALESCE<\/span><span style=\"color: gray\">(<\/span>event_data<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/data[@name=&quot;database_id&quot;]\/value)[1]'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'int'<\/span><span style=\"color: gray\">), \r\n        <\/span>event_data<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/action[@name=&quot;database_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>database_id<span style=\"color: gray\">,\r\n    <\/span>event_data<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/action[@name=&quot;session_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>[session_id]<span style=\"color: gray\">,\r\n    <\/span>event_data<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/data[@name=&quot;wait_type&quot;]\/text)[1]'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'nvarchar(4000)'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>[wait_type]<span style=\"color: gray\">,\r\n    <\/span>event_data<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/data[@name=&quot;opcode&quot;]\/text)[1]'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'nvarchar(4000)'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>[opcode]<span style=\"color: gray\">,\r\n    <\/span>event_data<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\">'bigint'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>[duration]<span style=\"color: gray\">,\r\n    <\/span>event_data<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/data[@name=&quot;max_duration&quot;]\/value)[1]'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'bigint'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>[max_duration]<span style=\"color: gray\">,\r\n    <\/span>event_data<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/data[@name=&quot;total_duration&quot;]\/value)[1]'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'bigint'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>[total_duration]<span style=\"color: gray\">,\r\n    <\/span>event_data<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/data[@name=&quot;signal_duration&quot;]\/value)[1]'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'bigint'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>[signal_duration]<span style=\"color: gray\">,\r\n    <\/span>event_data<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/data[@name=&quot;completed_count&quot;]\/value)[1]'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'bigint'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>[completed_count]<span style=\"color: gray\">,\r\n    <\/span>event_data<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/action[@name=&quot;plan_handle&quot;]\/value)[1]'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'nvarchar(4000)'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>[plan_handle]<span style=\"color: gray\">,\r\n    <\/span>event_data<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(4000)'<\/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>XEvent<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>event_data \r\n    <span style=\"color: blue\">FROM \r\n    <\/span><span style=\"color: gray\">(    <\/span><span style=\"color: green\">-- Cast the target_data to XML \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>TargetData \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_session_targets <\/span>st \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_sessions <\/span>s \r\n            <span style=\"color: blue\">ON <\/span>s<span style=\"color: gray\">.<\/span><span style=\"color: blue\">address <\/span><span style=\"color: gray\">= <\/span>st<span style=\"color: gray\">.<\/span>event_session_address \r\n        <span style=\"color: blue\">WHERE <\/span>name <span style=\"color: gray\">= <\/span><span style=\"color: red\">'TrackResourceWaits' \r\n          <\/span><span style=\"color: gray\">AND <\/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>Data \r\n    <span style=\"color: green\">-- Split out the Event Nodes \r\n    <\/span><span style=\"color: gray\">CROSS APPLY <\/span>TargetData<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>XEventData <span style=\"color: gray\">(<\/span>XEvent<span style=\"color: gray\">)   \r\n) <\/span><span style=\"color: blue\">AS <\/span>tab <span style=\"color: gray\">(<\/span>event_data<span style=\"color: gray\">)\r\n<\/span><\/pre>\n<\/blockquote>\n<p>&#160;<\/p>\n<p>In the result set, you will notice that some of the wait_info Events do not have an associated session_id, database_id, plan_handle, or sql_text value.&#160; Depending on where the wait actually occurs in code, this information is not available to the firing Event, for example, the NETWORK_IO Event generally does not successfully collect these Actions.<\/p>\n<p>While collecting session and statement level waits like this is certainly interesting, there are some considerations that have to be made whenever you look at wait information like this.&#160; The first consideration is that, while a specific session or statement waited on a resource, that doesn\u2019t necessarily mean that the problem exists within that session or statement.&#160; Take for example a query that has to wait 500ms on ASYNC_IO_COMPLETION waits.&#160; At the same time that query is executing there are 10 DSS queries running that scan large ranges of data from the database data files and generate a lot of IO activity.&#160; Where exactly is the problem?&#160; The root problem is that there is a disk IO bottleneck, but not necessarily related to the query that is waiting on disk IO, it could be another query performing Table Scan that is leading to the heavy IO activity.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While attending PASS Summit this year, I got the opportunity to hang out with Brent Ozar (Blog|Twitter) one afternoon while he did some work for Yanni Robel (Blog|Twitter).&#160; After looking at the wait stats information, Brent pointed out some potential problem points, and based on that information I pulled up my code for my PASS [&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-534","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.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>An XEvent a Day (30 of 31) \u2013 Tracking Session and Statement Level Waits - 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-30-of-31-tracking-session-and-statement-level-waits\/\" \/>\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 (30 of 31) \u2013 Tracking Session and Statement Level Waits - Jonathan Kehayias\" \/>\n<meta property=\"og:description\" content=\"While attending PASS Summit this year, I got the opportunity to hang out with Brent Ozar (Blog|Twitter) one afternoon while he did some work for Yanni Robel (Blog|Twitter).&#160; After looking at the wait stats information, Brent pointed out some potential problem points, and based on that information I pulled up my code for my PASS [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\/\" \/>\n<meta property=\"og:site_name\" content=\"Jonathan Kehayias\" \/>\n<meta property=\"article:published_time\" content=\"2010-12-30T23:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-04-13T18:41:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windows-live-writer\/anxeventaday30of31capturingsessionstatem\/412f6172\/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=\"10 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-30-of-31-tracking-session-and-statement-level-waits\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\\\/\"},\"author\":{\"name\":\"Jonathan Kehayias\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/#\\\/schema\\\/person\\\/01c10d94f3648654ef706d5e6305f69c\"},\"headline\":\"An XEvent a Day (30 of 31) \u2013 Tracking Session and Statement Level Waits\",\"datePublished\":\"2010-12-30T23:00:00+00:00\",\"dateModified\":\"2017-04-13T18:41:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\\\/\"},\"wordCount\":1238,\"commentCount\":2,\"image\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.SQLskills.com\\\/blogs\\\/jonathan\\\/wp-content\\\/uploads\\\/windows-live-writer\\\/anxeventaday30of31capturingsessionstatem\\\/412f6172\\\/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-30-of-31-tracking-session-and-statement-level-waits\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\\\/\",\"url\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\\\/\",\"name\":\"An XEvent a Day (30 of 31) \u2013 Tracking Session and Statement Level Waits - Jonathan Kehayias\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.SQLskills.com\\\/blogs\\\/jonathan\\\/wp-content\\\/uploads\\\/windows-live-writer\\\/anxeventaday30of31capturingsessionstatem\\\/412f6172\\\/image_thumb.png\",\"datePublished\":\"2010-12-30T23:00:00+00:00\",\"dateModified\":\"2017-04-13T18:41:51+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-30-of-31-tracking-session-and-statement-level-waits\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.SQLskills.com\\\/blogs\\\/jonathan\\\/wp-content\\\/uploads\\\/windows-live-writer\\\/anxeventaday30of31capturingsessionstatem\\\/412f6172\\\/image_thumb.png\",\"contentUrl\":\"https:\\\/\\\/www.SQLskills.com\\\/blogs\\\/jonathan\\\/wp-content\\\/uploads\\\/windows-live-writer\\\/anxeventaday30of31capturingsessionstatem\\\/412f6172\\\/image_thumb.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\\\/#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 (30 of 31) \u2013 Tracking Session and Statement Level Waits\"}]},{\"@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 (30 of 31) \u2013 Tracking Session and Statement Level Waits - 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-30-of-31-tracking-session-and-statement-level-waits\/","og_locale":"en_US","og_type":"article","og_title":"An XEvent a Day (30 of 31) \u2013 Tracking Session and Statement Level Waits - Jonathan Kehayias","og_description":"While attending PASS Summit this year, I got the opportunity to hang out with Brent Ozar (Blog|Twitter) one afternoon while he did some work for Yanni Robel (Blog|Twitter).&#160; After looking at the wait stats information, Brent pointed out some potential problem points, and based on that information I pulled up my code for my PASS [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\/","og_site_name":"Jonathan Kehayias","article_published_time":"2010-12-30T23:00:00+00:00","article_modified_time":"2017-04-13T18:41:51+00:00","og_image":[{"url":"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windows-live-writer\/anxeventaday30of31capturingsessionstatem\/412f6172\/image_thumb.png","type":"","width":"","height":""}],"author":"Jonathan Kehayias","twitter_misc":{"Written by":"Jonathan Kehayias","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\/#article","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\/"},"author":{"name":"Jonathan Kehayias","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/#\/schema\/person\/01c10d94f3648654ef706d5e6305f69c"},"headline":"An XEvent a Day (30 of 31) \u2013 Tracking Session and Statement Level Waits","datePublished":"2010-12-30T23:00:00+00:00","dateModified":"2017-04-13T18:41:51+00:00","mainEntityOfPage":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\/"},"wordCount":1238,"commentCount":2,"image":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\/#primaryimage"},"thumbnailUrl":"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windows-live-writer\/anxeventaday30of31capturingsessionstatem\/412f6172\/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-30-of-31-tracking-session-and-statement-level-waits\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\/","url":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\/","name":"An XEvent a Day (30 of 31) \u2013 Tracking Session and Statement Level Waits - Jonathan Kehayias","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\/#primaryimage"},"image":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\/#primaryimage"},"thumbnailUrl":"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windows-live-writer\/anxeventaday30of31capturingsessionstatem\/412f6172\/image_thumb.png","datePublished":"2010-12-30T23:00:00+00:00","dateModified":"2017-04-13T18:41:51+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-30-of-31-tracking-session-and-statement-level-waits\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\/#primaryimage","url":"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windows-live-writer\/anxeventaday30of31capturingsessionstatem\/412f6172\/image_thumb.png","contentUrl":"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windows-live-writer\/anxeventaday30of31capturingsessionstatem\/412f6172\/image_thumb.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-30-of-31-tracking-session-and-statement-level-waits\/#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 (30 of 31) \u2013 Tracking Session and Statement Level Waits"}]},{"@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\/534","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=534"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/posts\/534\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/media?parent=534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/categories?post=534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/tags?post=534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}