{"id":993,"date":"2019-01-24T10:36:49","date_gmt":"2019-01-24T18:36:49","guid":{"rendered":"http:\/\/3.209.169.194\/blogs\/erin\/?p=993"},"modified":"2019-01-24T13:35:16","modified_gmt":"2019-01-24T21:35:16","slug":"important-query-store-fixes-january-2019","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/erin\/important-query-store-fixes-january-2019\/","title":{"rendered":"Important Query Store Fixes &#8211; January 2019"},"content":{"rendered":"<p>The latest CUs for SQL Server 2016 and 2017 contain some important Query Store fixes that I thought worth mentioning for those of you on either version or those of you looking to upgrade.\u00a0 As of this writing, the current CU for SQL Server 2016 SP2 is <a href=\"https:\/\/support.microsoft.com\/en-us\/help\/4475776\/cumulative-update-5-for-sql-server-2016-sp2\">CU5<\/a>, and for SQL Server 2017 it is <a href=\"https:\/\/support.microsoft.com\/en-us\/help\/4466404\/cumulative-update-13-for-sql-server-2017\">CU13<\/a>.\u00a0 Many times we see fixes that make it into a SQL Server 2017 CU ported back to a SQL Server 2016 build.\u00a0 Interestingly enough, there are some Query Store fixes in 2016 CUs that are not in 2017 CUs.\u00a0 I don&#8217;t know if that&#8217;s because the issues do not exist in 2017, or if it&#8217;s just that they have been fixed yet in 2017.\u00a0 I&#8217;m planning to update this post if the fixes are added down the read.\u00a0 So here we go, in descending CU order&#8230;<\/p>\n<p><strong>SQL Server 2017 CU13<\/strong> &#8211; <a href=\"https:\/\/support.microsoft.com\/en-us\/help\/4480644\/fix-a-dump-file-may-be-generated-when-you-run-the-dml-internal-plan-on\">FIX: A dump file may be generated when you run the DML internal plan on Query Store enabled database in SQL Server 2017<\/a><\/p>\n<p style=\"padding-left: 30px;\">This will occur for anyone using Automatic Plan Correction (which means you will be on Enterprise Edition), as noted by having FORCE_LAST_GOOD_PLAN enabled.\u00a0 You can read more about Automatic Plan Correction <a href=\"https:\/\/sqlperformance.com\/2018\/02\/sql-plan\/automatic-plan-correction-in-sql-server\">here<\/a> (I&#8217;m a\u00a0 fan, it&#8217;s pretty cool and very helpful for those with small DBA teams and lots of databases, or those DBAs who just have too much on their plate and are constantly putting out fires).<\/p>\n<p><strong>SQL Server 2017 CU11 and SQL Server 2016 SP2 CU5<\/strong> &#8211; <a href=\"https:\/\/support.microsoft.com\/en-us\/help\/4461562\/transactions-and-log-truncation-may-be-blocked-when-using-query-store\">FIX: Transactions and log truncation may be blocked when you use Query Store in SQL Server 2016 and 2017<\/a><\/p>\n<p style=\"padding-left: 30px;\">I&#8217;m aware of multiple companies that have run into this issue and I&#8217;m glad to see that the fix was ported back to 2016.\u00a0 I highly recommend getting up to this CU if you can, as the resolution requires a restart (I&#8217;ve heard that killing the session_id also works but I haven&#8217;t seen that).\u00a0 Also note that the command referenced in the KB article is <em>ALTER DATABASE &lt;databasename&gt; SET QUERY_STORE_CLEAR<\/em>, but I have also seen this when trying to change one of the Query Store options (e.g. changing size or retention days).\u00a0 I am pretty sure it&#8217;s any ALTER DATABASE statement that changes Query Store configuration.<\/p>\n<p><strong>SQL Server 2016 SP2 CU5<\/strong> &#8211; <a href=\"https:\/\/support.microsoft.com\/en-us\/help\/4487094\/fix-query-store-enabled-database-takes-long-time-on-startup-after-you\">FIX: Query Store enabled database takes long time on startup after you apply cumulative update for a SQL Server version<\/a><\/p>\n<p style=\"padding-left: 30px;\">Note that this is applicable to systems with Availability Groups, and this is a fix that is not listed for any 2017 CU&#8230;I&#8217;ll keep watching to see if it shows up.<\/p>\n<p><strong>SQL Server 2016 SP2 CU4<\/strong> &#8211; <a href=\"https:\/\/support.microsoft.com\/en-us\/help\/4052133\/access-violation-when-sql-server-starts-query-store-during-startup\">FIX: Access violation when SQL Server 2016 tries to start Query Store Manager during startup<\/a><\/p>\n<p style=\"padding-left: 30px;\">This is also a fix that is not listed for any 2017 CU&#8230;<\/p>\n<p><strong>SQL Server 2017 CU5<\/strong> &#8211; <a href=\"https:\/\/support.microsoft.com\/en-us\/help\/4091063\/access-violation-occurs-when-query-store-collects-runtime-statistics\">FIX: Access violation occurs when Query Store collects runtime statistics in SQL Server 2017<\/a><\/p>\n<p style=\"padding-left: 30px;\">I don&#8217;t see this fix in any SQL Server 2016 CU, but I&#8217;ll keep watching.<\/p>\n<p><strong>SQL Server 2016 SP2 CU2<\/strong> &#8211; <a href=\"https:\/\/support.microsoft.com\/en-us\/help\/4340759\">FIX: Slow performance of SQL Server 2016 when Query Store is enabled<\/a><\/p>\n<p style=\"padding-left: 30px;\">There were many performance-related improvements for Query Store in SQL Server 2017, and huge props to the SQL Server team for getting these back-ported to 2016.\u00a0 At a bare minimum, this is the build you should be running, but I would rather see you on CU5 at this point.<\/p>\n<p><em>Note: If you installed CU2 for SQL Server 2017 at any point, please read: <a href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/query-store-fix-in-sql-server-2017\/\">Query Store Fix in SQL Server 2017<\/a> for an explanation of what you need to do when you apply a higher CU and why.<\/em><\/p>\n<p>You may look at this list of fixes and be concerned.\u00a0 Don&#8217;t be.\u00a0 These fixes are a good thing!\u00a0 They tell me that more and more people are using Query Store (which is great) and while they have run into issues, I believe it&#8217;s because these are bigger systems (see the access violation fix which is for systems with 256 logical cores) or they are interesting\/edge-case workloads, both of which probably don&#8217;t exist in Azure, and may be why these issues haven&#8217;t been seen previously.\u00a0 I remain, as always, a big proponent of Query Store.\u00a0 If you&#8217;re seeing something interesting feel free to comment here or drop me an email.\u00a0 I&#8217;ve had some folks do that and I was able to confirm they were seeing a bug and let them know that it would be fixed soon.\u00a0 I&#8217;ve had one or two other cases where it&#8217;s an issue I haven&#8217;t seen and I recommended contacting Product Support.\u00a0 Either way, if you&#8217;re unsure about Query Store I have lots of resources to get you started, to get it configured properly, and I answer the question &#8220;what about performance?!&#8221;.\u00a0 I hope this helps!<\/p>\n<ul>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=Y0MnxMDdxBs&amp;feature=youtu.be\">Answering the Question &#8220;What Happened?&#8221; with Query Store (video)<\/a><\/li>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=mLsR1H8hUbg&amp;feature=youtu.be\">Plan Stability Through Plan Forcing (video)<\/a><\/li>\n<li><a href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/query-store-settings\/\">Query Store Settings<\/a><\/li>\n<li><a href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/query-store-performance-overhead\/\">Query Store Performance Overhead: What you need to know<\/a><\/li>\n<li><a href=\"https:\/\/www.sqlskills.com\/blogs\/erin\/alter-database-set-query_store-command-is-blocked\/\">ALTER DATABASE SET QUERY_STORE command is blocked<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The latest CUs for SQL Server 2016 and 2017 contain some important Query Store fixes that I thought worth mentioning for those of you on either version or those of you looking to upgrade.\u00a0 As of this writing, the current CU for SQL Server 2016 SP2 is CU5, and for SQL Server 2017 it is [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.9.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Important Query Store Fixes - January 2019 - Erin Stellato<\/title>\n<meta name=\"description\" content=\"There have been numerous, query store fixes released in the latest CUs for 2016 and 2017, and I summarize them here.\" \/>\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\/erin\/important-query-store-fixes-january-2019\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Important Query Store Fixes - January 2019 - Erin Stellato\" \/>\n<meta property=\"og:description\" content=\"There have been numerous, query store fixes released in the latest CUs for 2016 and 2017, and I summarize them here.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/erin\/important-query-store-fixes-january-2019\/\" \/>\n<meta property=\"og:site_name\" content=\"Erin Stellato\" \/>\n<meta property=\"article:published_time\" content=\"2019-01-24T18:36:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-01-24T21:35:16+00:00\" \/>\n<meta name=\"author\" content=\"Erin Stellato\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Erin Stellato\" \/>\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\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/important-query-store-fixes-january-2019\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/important-query-store-fixes-january-2019\/\",\"name\":\"Important Query Store Fixes - January 2019 - Erin Stellato\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#website\"},\"datePublished\":\"2019-01-24T18:36:49+00:00\",\"dateModified\":\"2019-01-24T21:35:16+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/76170223ffffa1df03fd9be5b66cb158\"},\"description\":\"There have been numerous, query store fixes released in the latest CUs for 2016 and 2017, and I summarize them here.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/important-query-store-fixes-january-2019\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/erin\/important-query-store-fixes-january-2019\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/important-query-store-fixes-january-2019\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Important Query Store Fixes &#8211; January 2019\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/\",\"name\":\"Erin Stellato\",\"description\":\"The SQL Sequel\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/76170223ffffa1df03fd9be5b66cb158\",\"name\":\"Erin Stellato\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0c8b485bd54ea26b57e99f79b525f409?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0c8b485bd54ea26b57e99f79b525f409?s=96&d=mm&r=g\",\"caption\":\"Erin Stellato\"},\"sameAs\":[\"http:\/\/3.209.169.194\/blogs\/erin\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/erin\/author\/erin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Important Query Store Fixes - January 2019 - Erin Stellato","description":"There have been numerous, query store fixes released in the latest CUs for 2016 and 2017, and I summarize them here.","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\/erin\/important-query-store-fixes-january-2019\/","og_locale":"en_US","og_type":"article","og_title":"Important Query Store Fixes - January 2019 - Erin Stellato","og_description":"There have been numerous, query store fixes released in the latest CUs for 2016 and 2017, and I summarize them here.","og_url":"https:\/\/www.sqlskills.com\/blogs\/erin\/important-query-store-fixes-january-2019\/","og_site_name":"Erin Stellato","article_published_time":"2019-01-24T18:36:49+00:00","article_modified_time":"2019-01-24T21:35:16+00:00","author":"Erin Stellato","twitter_misc":{"Written by":"Erin Stellato","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/important-query-store-fixes-january-2019\/","url":"https:\/\/www.sqlskills.com\/blogs\/erin\/important-query-store-fixes-january-2019\/","name":"Important Query Store Fixes - January 2019 - Erin Stellato","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#website"},"datePublished":"2019-01-24T18:36:49+00:00","dateModified":"2019-01-24T21:35:16+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/76170223ffffa1df03fd9be5b66cb158"},"description":"There have been numerous, query store fixes released in the latest CUs for 2016 and 2017, and I summarize them here.","breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/important-query-store-fixes-january-2019\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/erin\/important-query-store-fixes-january-2019\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/important-query-store-fixes-january-2019\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/erin\/"},{"@type":"ListItem","position":2,"name":"Important Query Store Fixes &#8211; January 2019"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/erin\/","name":"Erin Stellato","description":"The SQL Sequel","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/erin\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/76170223ffffa1df03fd9be5b66cb158","name":"Erin Stellato","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/erin\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0c8b485bd54ea26b57e99f79b525f409?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0c8b485bd54ea26b57e99f79b525f409?s=96&d=mm&r=g","caption":"Erin Stellato"},"sameAs":["http:\/\/3.209.169.194\/blogs\/erin"],"url":"https:\/\/www.sqlskills.com\/blogs\/erin\/author\/erin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/posts\/993"}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/comments?post=993"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/posts\/993\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/media?parent=993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/categories?post=993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/erin\/wp-json\/wp\/v2\/tags?post=993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}