{"id":549,"date":"2010-12-15T19:11:00","date_gmt":"2010-12-15T19:11:00","guid":{"rendered":"\/blogs\/jonathan\/post\/An-XEvent-a-Day-(15-of-31)-Tracking-Ghost-Cleanup.aspx"},"modified":"2017-04-13T12:18:31","modified_gmt":"2017-04-13T16:18:31","slug":"an-xevent-a-day-15-of-31-tracking-ghost-cleanup","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\/","title":{"rendered":"An XEvent a Day (15 of 31) &#8211; Tracking Ghost Cleanup"},"content":{"rendered":"<p>If you don\u2019t know anything about Ghost Cleanup, I recommend highly that you go read Paul Randal\u2019s blog posts <a href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-the-storage-engine-ghost-cleanup-in-depth\/\">Inside the Storage Engine: Ghost cleanup in depth<\/a>, <a href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/ghost-cleanup-redux\/\">Ghost cleanup redux<\/a>, and <a href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/turning-off-the-ghost-cleanup-task-for-a-performance-gain\/\">Turning off the ghost cleanup task for a performance gain<\/a>.&#160; To my knowledge Paul\u2019s posts are the only things that cover Ghost Cleanup at any level online. <\/p>\n<p>In this post we\u2019ll look at how you can use Extended Events to track the activity of Ghost Cleanup inside of your SQL Server.&#160; To do this, we\u2019ll first take a look at the ghost_cleanup Event and what it returns.<\/p>\n<blockquote>\n<pre class=\"code\"><span style=\"color: green\">-- Find the Event\r\n<\/span><span style=\"color: blue\">SELECT \r\n    <\/span>p<span style=\"color: gray\">.<\/span>name<span style=\"color: gray\">, \r\n    <\/span>o<span style=\"color: gray\">.<\/span>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\">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>o<span style=\"color: gray\">.<\/span>name <span style=\"color: gray\">= <\/span><span style=\"color: red\">'ghost_cleanup'\r\n\r\n<\/span><span style=\"color: green\">-- Get the data columns for the Event\r\n<\/span><span style=\"color: blue\">SELECT \r\n    <\/span>name<span style=\"color: gray\">, \r\n    <\/span><span style=\"color: magenta\">TYPE_NAME\r\n<\/span><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\">'ghost_cleanup'\r\n  <\/span><span style=\"color: gray\">AND <\/span>column_type <span style=\"color: gray\">= <\/span><span style=\"color: red\">'data'<\/span><\/pre>\n<\/blockquote>\n<p><a href=\"http:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windowslivewriter\/anxeventaday15of31trackingghostcleanup\/79623400\/image.png\"><img fetchpriority=\"high\" 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\/windowslivewriter\/anxeventaday15of31trackingghostcleanup\/586ec159\/image_thumb.png\" width=\"316\" height=\"164\" \/><\/a> <\/p>\n<p>The ghost_cleanup Event is in the sqlserver Package and returns the file_id and page_id that the ghost cleanup process is working on.&#160; Since most SQL Servers have multiple databases, we probably will want to track the database_id through an Action as well.&#160; Since ghost cleanup is a background process, and we don\u2019t know much about how it works, or how many Events are going to be generated, we could start off with the synchronous_event_counter Target, but in this case, I just want to capture Events and all of them, so we will just go with the asynchronous_file_target.<\/p>\n<blockquote>\n<pre class=\"code\"><span style=\"color: blue\">CREATE EVENT SESSION <\/span>TrackGhostCleanup\r\n<span style=\"color: blue\">ON SERVER\r\nADD EVENT <\/span>sqlserver<span style=\"color: gray\">.<\/span>ghost_cleanup\r\n<span style=\"color: gray\">( <\/span><span style=\"color: blue\">ACTION<\/span><span style=\"color: gray\">(<\/span>sqlserver<span style=\"color: gray\">.<\/span>database_id<span style=\"color: gray\">))\r\n<\/span><span style=\"color: blue\">ADD TARGET <\/span>package0<span style=\"color: gray\">.<\/span>asynchronous_file_target<span style=\"color: gray\">(\r\n     <\/span><span style=\"color: blue\">SET filename<\/span><span style=\"color: gray\">=<\/span><span style=\"color: red\">'C:\\SQLBlog\\TrackGhostCleanup.xel'<\/span><span style=\"color: gray\">,\r\n         <\/span>metadatafile<span style=\"color: gray\">=<\/span><span style=\"color: red\">'C:\\SQLBlog\\TrackGhostCleanup.xem'<\/span><span style=\"color: gray\">)\r\n<\/span><span style=\"color: blue\">WITH <\/span><span style=\"color: gray\">(<\/span>MAX_MEMORY <span style=\"color: gray\">= <\/span>4MB<span style=\"color: gray\">, <\/span>EVENT_RETENTION_MODE <span style=\"color: gray\">= <\/span>NO_EVENT_LOSS <span style=\"color: gray\">)\r\n<\/span><span style=\"color: blue\">GO\r\nALTER EVENT SESSION <\/span>TrackGhostCleanup\r\n<span style=\"color: blue\">ON SERVER\r\nSTATE<\/span><span style=\"color: gray\">=<\/span>START<\/pre>\n<\/blockquote>\n<p><a href=\"http:\/\/www.11011.net\/software\/vspaste\"><\/a>This is a really basic Event Session, it captures one Event, sqlserver.ghost_cleanup and collects the sqlserver.database_id Action when the Event fires.&#160; The Event data is captured by the package0.asynchronous_file_target, and the Event Session is configured to not allow Event Loss.&#160; After the starting the Event Session and allowing it to run, we can query the files for the captured events and see how ghost_cleanup is running on our instance.<\/p>\n<blockquote>\n<pre class=\"code\"><span style=\"color: green\">-- Query the Event data from the Target.\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>event_data<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>event_data<span style=\"color: gray\">.<\/span>value<span style=\"color: gray\">(<\/span><span style=\"color: red\">'(event\/@id)[1]'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'int'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>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\/@version)[1]'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'int'<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS version<\/span><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>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\/data[@name=&quot;file_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><span style=\"color: magenta\">file_id<\/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\/data[@name=&quot;page_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>page_id\r\n<span style=\"color: blue\">FROM \r\n<\/span><span style=\"color: gray\">(<\/span><span style=\"color: blue\">SELECT\r\n    <\/span><span style=\"color: magenta\">CAST<\/span><span style=\"color: gray\">(<\/span>event_data <span style=\"color: blue\">AS XML<\/span><span style=\"color: gray\">) <\/span><span style=\"color: blue\">AS <\/span>event_data\r\n <span style=\"color: blue\">FROM <\/span><span style=\"color: green\">sys<\/span><span style=\"color: gray\">.<\/span>fn_xe_file_target_read_file<span style=\"color: gray\">(<\/span><span style=\"color: red\">'C:\\SQLBlog\\TrackGhostCleanup*.xel'<\/span><span style=\"color: gray\">, <\/span><span style=\"color: red\">'C:\\SQLBlog\\TrackGhostCleanup*xem'<\/span><span style=\"color: gray\">, null, null)\r\n) <\/span><span style=\"color: blue\">as <\/span>tab<\/pre>\n<\/blockquote>\n<p><a href=\"http:\/\/www.11011.net\/software\/vspaste\"><\/a>From around 15 minutes of runtime on one of my development servers, over 17.5K Events have fired, much more than I initially anticipated, and after nearly 30 minutes of runtime, I had just over 37K Events.&#160; <\/p>\n<blockquote>\n<p><a href=\"http:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windowslivewriter\/anxeventaday15of31trackingghostcleanup\/62bfe5b9\/image.png\"><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\/windowslivewriter\/anxeventaday15of31trackingghostcleanup\/766ccf4d\/image_thumb.png\" width=\"648\" height=\"131\" \/><\/a><\/p>\n<\/blockquote>\n<p>Some interesting information can be found in the Events.&#160; In SQL Server 2008, the Ghost Cleanup process runs every 10 seconds, just as Paul has documented in his blog posts, which was a change from every 5 seconds in SQL Server 2005.<\/p>\n<p><a href=\"http:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windowslivewriter\/anxeventaday15of31trackingghostcleanup\/5c98991e\/image.png\"><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\/windowslivewriter\/anxeventaday15of31trackingghostcleanup\/5b54003f\/image_thumb.png\" width=\"644\" height=\"128\" \/><\/a> <\/p>\n<p>The process in 2008 cleans up 200 pages at a time, something Paul hasn\u2019t specifically blogged about for SQL Server 2008.&#160; Before anyone debates this, Paul\u2019s statement \u201cIt will check through or cleanup a limited number of pages each time it wakes up &#8211; I remember the limit is 10 pages &#8211; to ensure it doesn&#8217;t swamp the system.\u201d from his <a href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-the-storage-engine-ghost-cleanup-in-depth\/\">Inside the Storage Engine: Ghost cleanup in depth<\/a> is based on SQL Server 2005, which also ran ghost cleanup every 5 seconds instead of 10 seconds.&#160; We can look at the Event information over subsequent 10 second intervals and see that 200 pages are cleaned up each time ghost_cleanup runs.<\/p>\n<p><a href=\"http:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windowslivewriter\/anxeventaday15of31trackingghostcleanup\/451de4ed\/image.png\"><img loading=\"lazy\" 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\/windowslivewriter\/anxeventaday15of31trackingghostcleanup\/58cace81\/image_thumb.png\" width=\"644\" height=\"127\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windowslivewriter\/anxeventaday15of31trackingghostcleanup\/097dd62d\/image.png\"><img loading=\"lazy\" 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\/windowslivewriter\/anxeventaday15of31trackingghostcleanup\/480323d3\/image_thumb.png\" width=\"644\" height=\"127\" \/><\/a><\/p>\n<p>This has to be one of my favorite aspects of Extended Events.&#160; You get to really learn about SQL Server Internals by just playing with SQL Server.&#160; I have a couple more blog posts that show how you can learn about SQL Server Internals using Extended Events for this series, and if you are interested in a previous post on the subject check out <a href=\"https:\/\/www.sqlskills.com\/blogs\/jonathan\/tsql-tuesday-11-physical-ios-dont-always-accumulate-wait-times\/\">TSQL Tuesday #11 \u2013 Physical IO\u2019s Don\u2019t Always Accumulate Wait Times<\/a>.<\/p>\n<p>Until tomorrow\u2026.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you don\u2019t know anything about Ghost Cleanup, I recommend highly that you go read Paul Randal\u2019s blog posts Inside the Storage Engine: Ghost cleanup in depth, Ghost cleanup redux, and Turning off the ghost cleanup task for a performance gain.&#160; To my knowledge Paul\u2019s posts are the only things that cover Ghost Cleanup at [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,38,40,45],"tags":[],"class_list":["post-549","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 (15 of 31) - Tracking Ghost Cleanup - 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-15-of-31-tracking-ghost-cleanup\/\" \/>\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 (15 of 31) - Tracking Ghost Cleanup - Jonathan Kehayias\" \/>\n<meta property=\"og:description\" content=\"If you don\u2019t know anything about Ghost Cleanup, I recommend highly that you go read Paul Randal\u2019s blog posts Inside the Storage Engine: Ghost cleanup in depth, Ghost cleanup redux, and Turning off the ghost cleanup task for a performance gain.&#160; To my knowledge Paul\u2019s posts are the only things that cover Ghost Cleanup at [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\/\" \/>\n<meta property=\"og:site_name\" content=\"Jonathan Kehayias\" \/>\n<meta property=\"article:published_time\" content=\"2010-12-15T19:11:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-04-13T16:18:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windowslivewriter\/anxeventaday15of31trackingghostcleanup\/586ec159\/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=\"4 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-15-of-31-tracking-ghost-cleanup\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\\\/\"},\"author\":{\"name\":\"Jonathan Kehayias\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/#\\\/schema\\\/person\\\/01c10d94f3648654ef706d5e6305f69c\"},\"headline\":\"An XEvent a Day (15 of 31) &#8211; Tracking Ghost Cleanup\",\"datePublished\":\"2010-12-15T19:11:00+00:00\",\"dateModified\":\"2017-04-13T16:18:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\\\/\"},\"wordCount\":551,\"image\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.SQLskills.com\\\/blogs\\\/jonathan\\\/wp-content\\\/uploads\\\/windowslivewriter\\\/anxeventaday15of31trackingghostcleanup\\\/586ec159\\\/image_thumb.png\",\"articleSection\":[\"Extended Events\",\"SQL Server 2008\",\"SQL Server Denali\",\"XEvent a Day Series\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\\\/\",\"url\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\\\/\",\"name\":\"An XEvent a Day (15 of 31) - Tracking Ghost Cleanup - Jonathan Kehayias\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.SQLskills.com\\\/blogs\\\/jonathan\\\/wp-content\\\/uploads\\\/windowslivewriter\\\/anxeventaday15of31trackingghostcleanup\\\/586ec159\\\/image_thumb.png\",\"datePublished\":\"2010-12-15T19:11:00+00:00\",\"dateModified\":\"2017-04-13T16:18:31+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-15-of-31-tracking-ghost-cleanup\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.SQLskills.com\\\/blogs\\\/jonathan\\\/wp-content\\\/uploads\\\/windowslivewriter\\\/anxeventaday15of31trackingghostcleanup\\\/586ec159\\\/image_thumb.png\",\"contentUrl\":\"https:\\\/\\\/www.SQLskills.com\\\/blogs\\\/jonathan\\\/wp-content\\\/uploads\\\/windowslivewriter\\\/anxeventaday15of31trackingghostcleanup\\\/586ec159\\\/image_thumb.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\\\/#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 (15 of 31) &#8211; Tracking Ghost Cleanup\"}]},{\"@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 (15 of 31) - Tracking Ghost Cleanup - 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-15-of-31-tracking-ghost-cleanup\/","og_locale":"en_US","og_type":"article","og_title":"An XEvent a Day (15 of 31) - Tracking Ghost Cleanup - Jonathan Kehayias","og_description":"If you don\u2019t know anything about Ghost Cleanup, I recommend highly that you go read Paul Randal\u2019s blog posts Inside the Storage Engine: Ghost cleanup in depth, Ghost cleanup redux, and Turning off the ghost cleanup task for a performance gain.&#160; To my knowledge Paul\u2019s posts are the only things that cover Ghost Cleanup at [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\/","og_site_name":"Jonathan Kehayias","article_published_time":"2010-12-15T19:11:00+00:00","article_modified_time":"2017-04-13T16:18:31+00:00","og_image":[{"url":"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windowslivewriter\/anxeventaday15of31trackingghostcleanup\/586ec159\/image_thumb.png","type":"","width":"","height":""}],"author":"Jonathan Kehayias","twitter_misc":{"Written by":"Jonathan Kehayias","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\/#article","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\/"},"author":{"name":"Jonathan Kehayias","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/#\/schema\/person\/01c10d94f3648654ef706d5e6305f69c"},"headline":"An XEvent a Day (15 of 31) &#8211; Tracking Ghost Cleanup","datePublished":"2010-12-15T19:11:00+00:00","dateModified":"2017-04-13T16:18:31+00:00","mainEntityOfPage":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\/"},"wordCount":551,"image":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\/#primaryimage"},"thumbnailUrl":"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windowslivewriter\/anxeventaday15of31trackingghostcleanup\/586ec159\/image_thumb.png","articleSection":["Extended Events","SQL Server 2008","SQL Server Denali","XEvent a Day Series"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\/","url":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\/","name":"An XEvent a Day (15 of 31) - Tracking Ghost Cleanup - Jonathan Kehayias","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\/#primaryimage"},"image":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\/#primaryimage"},"thumbnailUrl":"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windowslivewriter\/anxeventaday15of31trackingghostcleanup\/586ec159\/image_thumb.png","datePublished":"2010-12-15T19:11:00+00:00","dateModified":"2017-04-13T16:18:31+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-15-of-31-tracking-ghost-cleanup\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\/#primaryimage","url":"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windowslivewriter\/anxeventaday15of31trackingghostcleanup\/586ec159\/image_thumb.png","contentUrl":"https:\/\/www.SQLskills.com\/blogs\/jonathan\/wp-content\/uploads\/windowslivewriter\/anxeventaday15of31trackingghostcleanup\/586ec159\/image_thumb.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/an-xevent-a-day-15-of-31-tracking-ghost-cleanup\/#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 (15 of 31) &#8211; Tracking Ghost Cleanup"}]},{"@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\/549","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=549"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/posts\/549\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/media?parent=549"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/categories?post=549"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/tags?post=549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}