{"id":4359,"date":"2014-05-06T12:09:17","date_gmt":"2014-05-06T19:09:17","guid":{"rendered":"http:\/\/3.209.169.194\/blogs\/paul\/?p=4359"},"modified":"2017-04-13T11:42:00","modified_gmt":"2017-04-13T18:42:00","slug":"causes-io_completion-write_completion-sql-server-wait-types","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/paul\/causes-io_completion-write_completion-sql-server-wait-types\/","title":{"rendered":"Causes of IO_COMPLETION and WRITE_COMPLETION SQL Server wait types"},"content":{"rendered":"<p>(Check out my Pluralsight online training course: <em><a href=\"http:\/\/www.pluralsight.com\/training\/Courses\/TableOfContents\/sqlserver-waits\" target=\"_blank\">SQL Server: Performance Troubleshooting Using Wait Statistics<\/a>\u00a0<\/em>and my\u00a0<a href=\"https:\/\/www.sqlskills.com\/help\/waits\/\" target=\"_blank\">comprehensive library of all wait types and latch classes<\/a>.)<\/p>\n<p>In many of the sets of wait statistics I&#8217;ve been analyzing, the <em><a href=\"http:\/\/www.sqlskills.com\/help\/waits\/io_completion\/\" target=\"_blank\">IO_COMPLETION<\/a><\/em> and <em><a href=\"http:\/\/www.sqlskills.com\/help\/waits\/write_completion\/\" target=\"_blank\">WRITE_COMPLETION<\/a><\/em> waits show up (but never as the most prevalent wait type).<\/p>\n<p>The official definition of these wait types are:<\/p>\n<ul>\n<li><em>IO_COMPLETION<\/em>:\u00a0Occurs while waiting for I\/O operations to complete. This wait type generally represents non-data page I\/Os.\u00a0Data page I\/O completion waits appear as <em>PAGEIOLATCH_*<\/em> waits.<\/li>\n<li><em>WRITE_COMPLETION<\/em>:\u00a0Occurs when a write operation is in progress.<\/li>\n<\/ul>\n<p>I promised many of the people who sent me wait statistics recently that I would write a blog post giving more detailed information on when these wait types occur, so here it is.<\/p>\n<p>I used the Extended Events code in my post\u00a0<a href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/determine-causes-particular-wait-type\/\" target=\"_blank\">How to determine what causes a particular wait type<\/a>\u00a0to watch for these wait types occurring and then ran a variety of operations and analyzed the call stacks. There are way too many occurrences to document them all here, so I&#8217;ll summarize my findings below.<\/p>\n<p>Note that these are not lists are not exhaustive, but you get the idea of the kinds of operation where these wait types occur.<\/p>\n<p><em>IO_COMPLETION<\/em><\/p>\n<ul>\n<li>Reading log blocks from the transaction log (during any operation that causes the log to be read from disk &#8211; e.g. recovery)<\/li>\n<li>Reading allocation bitmaps from disk (e.g. GAM, SGAM, PFS pages) during many operations (e.g. recovery, DB startup, restore)<\/li>\n<li>Writing intermediate sort buffers to disk (these are called &#8216;Bobs&#8217;)<\/li>\n<li>Reading and writing merge results from\/to disk during a merge join<\/li>\n<li>Reading and writing eager spools to disk<\/li>\n<li>Reading VLF headers from the transaction log<\/li>\n<\/ul>\n<p><em>WRITE_COMPLETION<\/em><\/p>\n<ul>\n<li>Writing any page to a database snapshot (e.g. while running DBCC CHECK*, which is often the most common cause of this wait type)<\/li>\n<li>Writing VLF headers while creating or growing a transaction log file<\/li>\n<li>Writing a file&#8217;s header page to disk<\/li>\n<li>Writing portions of the transaction log during database startup<\/li>\n<li>Writing allocation pages to disk when creating or growing a data file<\/li>\n<\/ul>\n<p>These aren&#8217;t waits that I&#8217;d generally be concerned about, and I&#8217;d expect the individual resource wait times to be in line with those of the read and write latencies of the instance.<\/p>\n<p>Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>(Check out my Pluralsight online training course: SQL Server: Performance Troubleshooting Using Wait Statistics\u00a0and my\u00a0comprehensive library of all wait types and latch classes.) In many of the sets of wait statistics I&#8217;ve been analyzing, the IO_COMPLETION and WRITE_COMPLETION waits show up (but never as the most prevalent wait type). The official definition of these wait [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66,101],"tags":[],"class_list":["post-4359","post","type-post","status-publish","format-standard","hentry","category-performance-tuning","category-wait-stats"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Causes of IO_COMPLETION and WRITE_COMPLETION SQL Server wait types - 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\/causes-io_completion-write_completion-sql-server-wait-types\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Causes of IO_COMPLETION and WRITE_COMPLETION SQL Server wait types - Paul S. Randal\" \/>\n<meta property=\"og:description\" content=\"(Check out my Pluralsight online training course: SQL Server: Performance Troubleshooting Using Wait Statistics\u00a0and my\u00a0comprehensive library of all wait types and latch classes.) In many of the sets of wait statistics I&#8217;ve been analyzing, the IO_COMPLETION and WRITE_COMPLETION waits show up (but never as the most prevalent wait type). The official definition of these wait [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/causes-io_completion-write_completion-sql-server-wait-types\/\" \/>\n<meta property=\"og:site_name\" content=\"Paul S. Randal\" \/>\n<meta property=\"article:published_time\" content=\"2014-05-06T19:09:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-04-13T18:42:00+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=\"2 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\/causes-io_completion-write_completion-sql-server-wait-types\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/causes-io_completion-write_completion-sql-server-wait-types\/\",\"name\":\"Causes of IO_COMPLETION and WRITE_COMPLETION SQL Server wait types - Paul S. Randal\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\"},\"datePublished\":\"2014-05-06T19:09:17+00:00\",\"dateModified\":\"2017-04-13T18:42:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/causes-io_completion-write_completion-sql-server-wait-types\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/paul\/causes-io_completion-write_completion-sql-server-wait-types\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/causes-io_completion-write_completion-sql-server-wait-types\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Causes of IO_COMPLETION and WRITE_COMPLETION SQL Server wait types\"}]},{\"@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":"Causes of IO_COMPLETION and WRITE_COMPLETION SQL Server wait types - 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\/causes-io_completion-write_completion-sql-server-wait-types\/","og_locale":"en_US","og_type":"article","og_title":"Causes of IO_COMPLETION and WRITE_COMPLETION SQL Server wait types - Paul S. Randal","og_description":"(Check out my Pluralsight online training course: SQL Server: Performance Troubleshooting Using Wait Statistics\u00a0and my\u00a0comprehensive library of all wait types and latch classes.) In many of the sets of wait statistics I&#8217;ve been analyzing, the IO_COMPLETION and WRITE_COMPLETION waits show up (but never as the most prevalent wait type). The official definition of these wait [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/paul\/causes-io_completion-write_completion-sql-server-wait-types\/","og_site_name":"Paul S. Randal","article_published_time":"2014-05-06T19:09:17+00:00","article_modified_time":"2017-04-13T18:42:00+00:00","author":"Paul Randal","twitter_misc":{"Written by":"Paul Randal","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/causes-io_completion-write_completion-sql-server-wait-types\/","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/causes-io_completion-write_completion-sql-server-wait-types\/","name":"Causes of IO_COMPLETION and WRITE_COMPLETION SQL Server wait types - Paul S. Randal","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website"},"datePublished":"2014-05-06T19:09:17+00:00","dateModified":"2017-04-13T18:42:00+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/causes-io_completion-write_completion-sql-server-wait-types\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/paul\/causes-io_completion-write_completion-sql-server-wait-types\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/causes-io_completion-write_completion-sql-server-wait-types\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/paul\/"},{"@type":"ListItem","position":2,"name":"Causes of IO_COMPLETION and WRITE_COMPLETION SQL Server wait types"}]},{"@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\/4359","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=4359"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/4359\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/media?parent=4359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/categories?post=4359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/tags?post=4359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}