{"id":776,"date":"2009-10-15T16:13:00","date_gmt":"2009-10-15T16:13:00","guid":{"rendered":"\/blogs\/paul\/post\/Tracking-expensive-queries-with-extended-events-in-SQL-2008.aspx"},"modified":"2017-04-13T11:41:27","modified_gmt":"2017-04-13T18:41:27","slug":"tracking-expensive-queries-with-extended-events-in-sql-2008","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/paul\/tracking-expensive-queries-with-extended-events-in-sql-2008\/","title":{"rendered":"Tracking expensive queries with extended events in SQL 2008"},"content":{"rendered":"<p><span style=\"font-family: verdana, geneva; font-size: small;\">As part of the 2008 DBA class we&#8217;re teaching down here in Melbourne, I did a demo of using predicates and file targets with extended events, so I want to blog the script for people to play with. <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">For background info on extended events see: <\/span><\/p>\n<ul>\n<li>\n<div><span style=\"font-family: verdana, geneva; font-size: small;\">My TechNet Magazine article from 2008: <\/span><a href=\"https:\/\/technet.microsoft.com\/en-us\/library\/2009.01.sql2008.aspx\"><span style=\"font-family: verdana, geneva; font-size: small;\">Advanced Troubleshooting with Extended Events<\/span><\/a><\/div>\n<\/li>\n<li>\n<div><a href=\"http:\/\/sqlblog.com\/blogs\/jonathan_kehayias\/\"><span style=\"font-family: verdana, geneva; font-size: small;\">Jonathan Kehayias<\/span><\/a><span style=\"font-family: verdana, geneva; font-size: small;\">&#8216; excellent whitepaper: <\/span><a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/dd822788.aspx\"><span style=\"font-family: verdana, geneva; font-size: small;\">Using SQL Server 2008 Extended Events<\/span><\/a><\/div>\n<\/li>\n<li>\n<div><span style=\"font-family: verdana, geneva; font-size: small;\">Previous <\/span><a href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/getting-historical-deadlock-info-using-extended-events\/\"><span style=\"font-family: verdana, geneva; font-size: small;\">blog post<\/span><\/a><span style=\"font-family: verdana, geneva; font-size: small;\"> on using the system health event session to get historical deadlock info <\/span><\/div>\n<\/li>\n<\/ul>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">In this scenario, I&#8217;d like to track queries that make heavy usage of the CPU on my system. <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">First off I&#8217;ll create a test database to play with. <\/span><\/p>\n<blockquote><p><span style=\"font-family: 'courier new', courier; font-size: small;\">USE MASTER;<br \/>\nGO<br \/>\nIF DATABASEPROPERTYEX (&#8216;production&#8217;, &#8216;Version&#8217;) &gt; 0 DROP DATABASE production;<br \/>\nGO <\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier; font-size: small;\">CREATE DATABASE production;<br \/>\nGO<br \/>\nUSE production;<br \/>\nGO <\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier; font-size: small;\">CREATE TABLE t1 (c1 INT IDENTITY, c2 UNIQUEIDENTIFIER ROWGUIDCOL DEFAULT NEWID(), c3 CHAR (5000) DEFAULT &#8216;a&#8217;);<br \/>\nCREATE CLUSTERED INDEX t1_CL ON t1 (c1);<br \/>\nCREATE NONCLUSTERED INDEX t1_NCL ON t1 (c2);<br \/>\nGO <\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier; font-size: small;\">SET NOCOUNT ON;<br \/>\nINSERT INTO t1 DEFAULT VALUES;<br \/>\nGO 1000 <\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier; font-size: small;\">&#8212; Get the database ID to plug into the event session<br \/>\nSELECT DB_ID (&#8216;production&#8217;);<br \/>\nGO <\/span><\/p><\/blockquote>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Notice that I grabbed the database ID of the new database I created, as I&#8217;ll need that when defining the extended event predicate. <\/span><\/p>\n<blockquote><p><span style=\"font-family: 'courier new', courier; font-size: small;\">IF EXISTS (SELECT * FROM sys.server_event_sessions WHERE name = &#8216;EE_ExpensiveQueries&#8217;)<br \/>\nDROP EVENT SESSION EE_ExpensiveQueries ON SERVER;<br \/>\nGO <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\"><span style=\"font-family: 'courier new', courier;\">CREATE EVENT SESSION EE_ExpensiveQueries ON SERVER<br \/>\nADD EVENT sqlserver.sql_statement_completed<br \/>\n(ACTION (sqlserver.sql_text, sqlserver.plan_handle)<br \/>\nWHERE sqlserver.database_id = 18 \/*DBID*\/\u00a0 AND cpu_time &gt; 10000 \/*total ms of CPU time*\/)<br \/>\nADD TARGET package0.asynchronous_file_target<br \/>\n(SET FILENAME = N&#8217;C:\\SQLskills\\EE_ExpensiveQueries.xel&#8217;,\u00a0METADATAFILE = N&#8217;C:\\SQLskills\\EE_ExpensiveQueries.xem&#8217;)<br \/>\nWITH (max_dispatch_latency = 1 seconds);<br \/>\nGO<\/span> <\/span><\/p><\/blockquote>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">I&#8217;m monitoring the event that fires whenever a statement completes, and I&#8217;m filtering by database ID (make sure you plug in the correct database ID when you try this yourself) and by the number of milliseconds of CPU time the statement used. <strong>Note:<\/strong> when using predicates you should always make sure that you order the predicate tests such that the most restrictive predicates (those most likely to evaluate to false) are first in the list, so the predicate evaluation &#8216;short-circuits&#8217; as quickly as possible (a standard programming practice with boolean logic). I&#8217;m also using a file target, just to show how it can be done, instead of the ring buffer which is commonly used for extended events demos. <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Now I&#8217;m going to turn on the event session and do some queries in the <span style=\"font-family: 'courier new', courier;\">production<\/span> database. <\/span><\/p>\n<blockquote><p><span style=\"font-family: 'courier new', courier; font-size: small;\">ALTER EVENT SESSION EE_ExpensiveQueries ON SERVER STATE = START;<br \/>\nGO <\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier; font-size: small;\">USE production;<br \/>\nGO <\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier; font-size: small;\">SELECT COUNT (*) FROM t1 WHERE c1 &gt; 500;<br \/>\nGO <\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier; font-size: small;\">SELECT SUM (c1) FROM t1 WHERE c3 LIKE &#8216;a&#8217;;<br \/>\nGO <\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier; font-size: small;\">ALTER INDEX t1_CL ON t1 REORGANIZE;<br \/>\nGO <\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier; font-size: small;\">ALTER INDEX t1_CL ON t1 REBUILD;<br \/>\nGO <\/span><\/p><\/blockquote>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">That should have generated some long-running queries. Now I&#8217;ll switch in to the context of <span style=\"font-family: 'courier new', courier;\">master<\/span> (so the querying of the event session itself doesn&#8217;t get captured by the event session) and see what I&#8217;ve captured. <\/span><\/p>\n<blockquote><p><span style=\"font-family: 'courier new', courier; font-size: small;\">USE master;<br \/>\nGO <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\"><span style=\"font-family: 'courier new', courier;\">SELECT COUNT (*)\u00a0FROM sys.fn_xe_file_target_read_file<br \/>\n(&#8216;C:\\SQLskills\\EE_ExpensiveQueries*.xel&#8217;,\u00a0&#8216;C:\\SQLskills\\EE_ExpensiveQueries*.xem&#8217;, NULL, NULL);<br \/>\nGO<\/span> <\/span><\/p><\/blockquote>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">In this case I&#8217;ve got 3 entries. I can pull these out using the following code: <\/span><\/p>\n<blockquote><p><span style=\"font-family: verdana, geneva; font-size: small;\"><span style=\"font-family: 'courier new', courier;\">SELECT data FROM<br \/>\n(SELECT CONVERT (XML, event_data) AS data FROM sys.fn_xe_file_target_read_file<br \/>\n(&#8216;C:\\SQLskills\\EE_ExpensiveQueries*.xel&#8217;, &#8216;C:\\SQLskills\\EE_ExpensiveQueries*.xem&#8217;, NULL, NULL)<br \/>\n) entries;<br \/>\nGO<\/span> <\/span><\/p><\/blockquote>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">But I get three XML blobs back, like so: <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">\u00a0<img fetchpriority=\"high\" decoding=\"async\" src=\"\/blogs\/paul\/wp-content\/uploads\/2009\/10\/eedemo1.jpg\" alt=\"\" width=\"613\" height=\"141\" \/> <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">What&#8217;s more useful is to pull everything out of the XML blob programmatically using the code below: <\/span><\/p>\n<blockquote><p><span style=\"font-family: 'courier new', courier; font-size: small;\">SELECT<br \/>\ndata.value (<br \/>\n&#8216;(\/event[@name=&#8221;sql_statement_completed&#8221;]\/@timestamp)[1]&#8217;, &#8216;DATETIME&#8217;) AS [Time],<br \/>\ndata.value (<br \/>\n&#8216;(\/event\/data[@name=&#8221;cpu&#8221;]\/value)[1]&#8217;, &#8216;INT&#8217;) AS [CPU (ms)],<br \/>\nCONVERT (FLOAT, data.value (&#8216;(\/event\/data[@name=&#8221;duration&#8221;]\/value)[1]&#8217;, &#8216;BIGINT&#8217;)) \/ 1000000<br \/>\nAS [Duration (s)],<br \/>\ndata.value (<br \/>\n&#8216;(\/event\/action[@name=&#8221;sql_text&#8221;]\/value)[1]&#8217;, &#8216;VARCHAR(MAX)&#8217;) AS [SQL Statement],<br \/>\n&#8216;0x&#8217; + data.value (&#8216;(\/event\/action[@name=&#8221;plan_handle&#8221;]\/value)[1]&#8217;, &#8216;VARCHAR(100)&#8217;)\u00a0AS [Plan Handle]<br \/>\nFROM<br \/>\n(SELECT CONVERT (XML, event_data) AS data FROM sys.fn_xe_file_target_read_file<br \/>\n(&#8216;C:\\SQLskills\\EE_ExpensiveQueries*.xel&#8217;, &#8216;C:\\SQLskills\\EE_ExpensiveQueries*.xem&#8217;, null, null)<br \/>\n) entries<br \/>\nORDER BY [Time] DESC;<br \/>\nGO <\/span><\/p>\n<p><span style=\"font-family: 'courier new', courier; font-size: small;\">Time\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CPU (ms) Duration (s) SQL Statement\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Plan Handle<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n2009-10-16 17:59:29.623 30\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1.214875\u00a0\u00a0\u00a0\u00a0 ALTER INDEX t1_CL ON t1 REBUILD;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0x06001000EB672A07B8C0C807000000000000000000000000<br \/>\n2009-10-16 17:59:28.407 20\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.024076\u00a0\u00a0\u00a0\u00a0 ALTER INDEX t1_CL ON t1 REORGANIZE;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0x0600100003594903B8C0C807000000000000000000000000<br \/>\n2009-10-16 17:59:28.343 51\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.045144\u00a0\u00a0\u00a0\u00a0 SELECT SUM (c1) FROM t1 WHERE c3 LIKE &#8216;a&#8217;; 0x06001000FAF5B11EB820C307000000000000000000000000<\/span><\/p><\/blockquote>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Now I can plug in one of the plan handles to a query of <span style=\"font-family: 'courier new', courier;\">sys.dm_exec_query_plan<\/span> to get the graphical query plan: <\/span><\/p>\n<blockquote><p><span style=\"font-family: verdana, geneva; font-size: small;\"><span style=\"font-family: 'courier new', courier;\">SELECT [query_plan] FROM sys.dm_exec_query_plan (0x06001000FAF5B11EB820C307000000000000000000000000);<br \/>\nGO<\/span> <\/span><\/p><\/blockquote>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">And clicking on the resulting XML &#8216;link&#8217; gives the query plan: <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">\u00a0<img decoding=\"async\" src=\"\/blogs\/paul\/wp-content\/uploads\/2009\/10\/eedemo2.jpg\" alt=\"\" width=\"547\" height=\"102\" \/> <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">\u00a0<img decoding=\"async\" src=\"\/blogs\/paul\/wp-content\/uploads\/2009\/10\/eedemo3.jpg\" alt=\"\" width=\"779\" height=\"158\" \/> <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">And now I can tweak the production workload to potentially behave better. <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Just for kicks I went back into the context of the <span style=\"font-family: 'courier new', courier;\">production<\/span> database and ran the XML parsing again to capture the query plan &#8211; try it yourself &#8211; pretty gnarly! :-) <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Now, if I was going to make this more useful, I&#8217;d use a ring buffer target, with a polling mechanism every few seconds to make sure that I can capture the graphical query plan for expensive queries before the plan is pushed out of cache &#8211; maybe I&#8217;ll get around to doing that and publish the complete solution. <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">In the meantime, here&#8217;s a zip file containing the entire script that you can download and play with: <\/span><a href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2009\/10\/ee_expensivequeries.zip\"><span style=\"font-family: verdana, geneva; font-size: small;\">EE_ExpensiveQueries.zip (1.72 kb)<\/span><\/a><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Enjoy!<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As part of the 2008 DBA class we&#8217;re teaching down here in Melbourne, I did a demo of using predicates and file targets with extended events, so I want to blog the script for people to play with. For background info on extended events see: My TechNet Magazine article from 2008: Advanced Troubleshooting with Extended [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39,66,86],"tags":[],"class_list":["post-776","post","type-post","status-publish","format-standard","hentry","category-extended-events","category-performance-tuning","category-sql-server-2008"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Tracking expensive queries with extended events in SQL 2008 - Paul S. Randal<\/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\/paul\/tracking-expensive-queries-with-extended-events-in-sql-2008\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Tracking expensive queries with extended events in SQL 2008 - Paul S. Randal\" \/>\n<meta property=\"og:description\" content=\"As part of the 2008 DBA class we&#8217;re teaching down here in Melbourne, I did a demo of using predicates and file targets with extended events, so I want to blog the script for people to play with. For background info on extended events see: My TechNet Magazine article from 2008: Advanced Troubleshooting with Extended [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/tracking-expensive-queries-with-extended-events-in-sql-2008\/\" \/>\n<meta property=\"og:site_name\" content=\"Paul S. Randal\" \/>\n<meta property=\"article:published_time\" content=\"2009-10-15T16:13:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-04-13T18:41:27+00:00\" \/>\n<meta name=\"author\" content=\"Paul Randal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Paul Randal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/tracking-expensive-queries-with-extended-events-in-sql-2008\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/tracking-expensive-queries-with-extended-events-in-sql-2008\/\",\"name\":\"Tracking expensive queries with extended events in SQL 2008 - Paul S. Randal\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\"},\"datePublished\":\"2009-10-15T16:13:00+00:00\",\"dateModified\":\"2017-04-13T18:41:27+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/tracking-expensive-queries-with-extended-events-in-sql-2008\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/paul\/tracking-expensive-queries-with-extended-events-in-sql-2008\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/tracking-expensive-queries-with-extended-events-in-sql-2008\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tracking expensive queries with extended events in SQL 2008\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\",\"name\":\"Paul S. Randal\",\"description\":\"In Recovery...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/?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\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\",\"name\":\"Paul Randal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"caption\":\"Paul Randal\"},\"sameAs\":[\"http:\/\/3.209.169.194\/blogs\/paul\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Tracking expensive queries with extended events in SQL 2008 - Paul S. Randal","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\/paul\/tracking-expensive-queries-with-extended-events-in-sql-2008\/","og_locale":"en_US","og_type":"article","og_title":"Tracking expensive queries with extended events in SQL 2008 - Paul S. Randal","og_description":"As part of the 2008 DBA class we&#8217;re teaching down here in Melbourne, I did a demo of using predicates and file targets with extended events, so I want to blog the script for people to play with. For background info on extended events see: My TechNet Magazine article from 2008: Advanced Troubleshooting with Extended [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/paul\/tracking-expensive-queries-with-extended-events-in-sql-2008\/","og_site_name":"Paul S. Randal","article_published_time":"2009-10-15T16:13:00+00:00","article_modified_time":"2017-04-13T18:41:27+00:00","author":"Paul Randal","twitter_misc":{"Written by":"Paul Randal","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/tracking-expensive-queries-with-extended-events-in-sql-2008\/","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/tracking-expensive-queries-with-extended-events-in-sql-2008\/","name":"Tracking expensive queries with extended events in SQL 2008 - Paul S. Randal","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website"},"datePublished":"2009-10-15T16:13:00+00:00","dateModified":"2017-04-13T18:41:27+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/tracking-expensive-queries-with-extended-events-in-sql-2008\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/paul\/tracking-expensive-queries-with-extended-events-in-sql-2008\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/tracking-expensive-queries-with-extended-events-in-sql-2008\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/paul\/"},{"@type":"ListItem","position":2,"name":"Tracking expensive queries with extended events in SQL 2008"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/","name":"Paul S. Randal","description":"In Recovery...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/paul\/?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\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce","name":"Paul Randal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","caption":"Paul Randal"},"sameAs":["http:\/\/3.209.169.194\/blogs\/paul"],"url":"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/776","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/comments?post=776"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/776\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/media?parent=776"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/categories?post=776"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/tags?post=776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}