{"id":16603,"date":"2021-08-11T09:24:19","date_gmt":"2021-08-11T07:24:19","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\/"},"modified":"2021-08-11T09:24:19","modified_gmt":"2021-08-11T07:24:19","slug":"sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\/","title":{"rendered":"SQL Server: Using Client Statistics to validate a query regression after a change in the database compatibility level"},"content":{"rendered":"<p>Few days ago, I have very poor performance on a database that I migrate from SQL 2012 to SQL 2019.<br \/>\nThe developer Team asks me to upgrade the number of CPU and the Memory to have better performance.<br \/>\nFirst, I ask the Team to give me some queries sample to test the performance between the old environment in SQL server 2012 and the new one in SQL server 2019.<br \/>\nTo do the test, I use the option in SQL Server Management Studio: <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/ssms\/f1-help\/database-engine-query-editor-sql-server-management-studio?redirectedfrom=MSDN&amp;view=sql-server-ver15#include-client-statistics-using-the-context-menu\" target=\"_blank\" rel=\"noopener\">Client Statistics<\/a><\/p>\n<p>Before I begin all tests and between all changes that I perform, I will reset the Client Statistics.<br \/>\nTo reset it, go to Query&gt; Reset Client Statistics:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Client_Statistics_00.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-51047 aligncenter\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Client_Statistics_00.png\" alt=\"\" width=\"300\" height=\"254\" \/><\/a><\/p>\n<p>For all test, I run 5 times the query.<br \/>\nFirst, I test with the default value when I migrate:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">USE TestDB\nGO\nALTER DATABASE SCOPED CONFIGURATION SET LEGACY_CARDINALITY_ESTIMATION = OFF;\nGO\nALTER DATABASE TestDB SET COMPATIBILITY_LEVEL = 150\nGO<\/pre>\n<p>To have the Client Statistics, go to the menu, at the right from &#8220;Include Live Query Statistics&#8221; , click to enable it<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Client_Statistics_01.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-51046 aligncenter\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Client_Statistics_01.png\" alt=\"\" width=\"300\" height=\"98\" \/><\/a><\/p>\n<p>I run 5 times the query and have this result on the Tab Client Statistics:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Client_Statistics_02a.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-51044 aligncenter\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Client_Statistics_02a.png\" alt=\"\" width=\"300\" height=\"119\" \/><\/a><br \/>\nAs reference, I have now the three last lines in the Average Column:<\/p>\n<ul>\n<li>Client processing time : 1336,6<\/li>\n<li>Total execution time : 2242,6<\/li>\n<li>Wait time on server replies : 906<\/li>\n<\/ul>\n<p>Now I do a reset and change only the compatibility level to the old one:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">ALTER DATABASE TestDB SET COMPATIBILITY_LEVEL = 110\nGO<\/pre>\n<p>I run 5 times the query and have this result on the Tab Client Statistics:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Client_Statistics_03a.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-51045 aligncenter\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Client_Statistics_03a.png\" alt=\"\" width=\"300\" height=\"120\" \/><\/a><\/p>\n<p>I have with the old Compatibility level this result:<\/p>\n<ul>\n<li>Client processing time : 389<\/li>\n<li>Total execution time : 1082,2<\/li>\n<li>Wait time on server replies : 693,2<\/li>\n<\/ul>\n<p>At this Point, no real performance gain with the compatibility level changes<br \/>\nNow, I change the Cardinality Estimation to the old one and the Compatibility level to 150<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">USE TestDB\nGO\nALTER DATABASE SCOPED CONFIGURATION SET LEGACY_CARDINALITY_ESTIMATION = ON;\nGO\nALTER DATABASE TestDB SET COMPATIBILITY_LEVEL = 150\nGO<\/pre>\n<p>I reset the Client Statistics and run 5 times the query:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Client_Statistics_04a.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-51043 aligncenter\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Client_Statistics_04a.png\" alt=\"\" width=\"300\" height=\"129\" \/><\/a><br \/>\nI have with the old Cardinality Estimation and the Compatibility level this result:<\/p>\n<ul>\n<li>Client processing time : 1083,2<\/li>\n<li>Total execution time : 1905,6<\/li>\n<li>Wait time on server replies : 882,4<\/li>\n<\/ul>\n<p>Now I do a reset and change only the compatibility level to the old one:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">ALTER DATABASE TestDB SET COMPATIBILITY_LEVEL = 110\nGO<\/pre>\n<p>I reset the Client Statistics and run 5 times the query for the last time:<\/p>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Client_Statistics_05a.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-51042 aligncenter\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Client_Statistics_05a.png\" alt=\"\" width=\"300\" height=\"126\" \/><\/a><br \/>\nThe last result is:<\/p>\n<ul>\n<li>Client processing time : 401,2<\/li>\n<li>Total execution time : 1140,4<\/li>\n<li>Wait time on server replies : 739,2<\/li>\n<\/ul>\n<p>Finally, in my case, the Cardinatity Estimation don&#8217;t change the performance after the migration but the compatibility level change the performance (~2 times better).<br \/>\nI will keep the compatibility level at SQL 2012 and not upgrate to SQL 2019&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Few days ago, I have very poor performance on a database that I migrate from SQL 2012 to SQL 2019. The developer Team asks me to upgrade the number of CPU and the Memory to have better performance. First, I ask the Team to give me some queries sample to test the performance between the&hellip;&nbsp;<\/p>\n","protected":false},"author":15,"featured_media":16609,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","neve_meta_reading_time":"","_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[4133],"tags":[49,67],"class_list":["post-16603","post","type-post","status-publish","format-standard","has-post-thumbnail","category-database","tag-microsoft","tag-performance"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.9 (Yoast SEO v29.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>SQL Server: Using Client Statistics to validate a query regression after a change in the database compatibility level - dbi services Blog<\/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.dbi-services.com\/blog\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Server: Using Client Statistics to validate a query regression after a change in the database compatibility level\" \/>\n<meta property=\"og:description\" content=\"Few days ago, I have very poor performance on a database that I migrate from SQL 2012 to SQL 2019. The developer Team asks me to upgrade the number of CPU and the Memory to have better performance. First, I ask the Team to give me some queries sample to test the performance between the&hellip;&nbsp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi services Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dbiservices\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-11T07:24:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Client_Statistics_05a.png\" \/>\n\t<meta property=\"og:image:width\" content=\"867\" \/>\n\t<meta property=\"og:image:height\" content=\"365\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"St\u00e9phane Haby\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:site\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"St\u00e9phane Haby\" \/>\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\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\\\/\"},\"author\":{\"name\":\"St\u00e9phane Haby\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/7980252d7d7a521e285e7c66114cf82a\"},\"headline\":\"SQL Server: Using Client Statistics to validate a query regression after a change in the database compatibility level\",\"datePublished\":\"2021-08-11T07:24:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\\\/\"},\"wordCount\":394,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/Client_Statistics_05a.png\",\"keywords\":[\"Microsoft\",\"Performance\"],\"articleSection\":[\"Database\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\\\/\",\"name\":\"SQL Server: Using Client Statistics to validate a query regression after a change in the database compatibility level - dbi services Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/Client_Statistics_05a.png\",\"datePublished\":\"2021-08-11T07:24:19+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/Client_Statistics_05a.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/Client_Statistics_05a.png\",\"width\":867,\"height\":365},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server: Using Client Statistics to validate a query regression after a change in the database compatibility level\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi services Blog\",\"description\":\"#BeSharing\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\",\"name\":\"dbi services\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"width\":512,\"height\":512,\"caption\":\"dbi services\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/dbiservices\\\/\",\"https:\\\/\\\/x.com\\\/dbiservices\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/dbi-services\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/dbiservices\"],\"description\":\"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.\",\"email\":\"info@dbi-services.com\",\"telephone\":\"+41 32 422 96 00\",\"legalName\":\"dbi services SA\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/7980252d7d7a521e285e7c66114cf82a\",\"name\":\"St\u00e9phane Haby\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/STH_web-min-scaled.jpg\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/STH_web-min-scaled.jpg\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/STH_web-min-scaled.jpg\",\"caption\":\"St\u00e9phane Haby\"},\"description\":\"St\u00e9phane Haby has more than 20 years of experience in Microsoft solutions, specializing in the installation, migration, best practices, and performance analysis of Microsoft SQL Server, as well as Microsoft Business Intelligence solutions (SharePoint, Office) and .NET development for the banking sector. A former Microsoft Most Valuable Professional (MVP) and early adopter of Microsoft Team System in France, he has authored several technical articles. He holds Microsoft Certified Solutions Associate (MCSA) and Expert (MCSE) for SQL Server, MCTS, MCITP for SQL Server 2008, and ITIL V3 Foundation certifications. His industry experience covers chemicals and pharma, banking, and financial services.\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/stephane-haby\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"SQL Server: Using Client Statistics to validate a query regression after a change in the database compatibility level - dbi services Blog","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.dbi-services.com\/blog\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\/","og_locale":"en_US","og_type":"article","og_title":"SQL Server: Using Client Statistics to validate a query regression after a change in the database compatibility level","og_description":"Few days ago, I have very poor performance on a database that I migrate from SQL 2012 to SQL 2019. The developer Team asks me to upgrade the number of CPU and the Memory to have better performance. First, I ask the Team to give me some queries sample to test the performance between the&hellip;&nbsp;","og_url":"https:\/\/www.dbi-services.com\/blog\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\/","og_site_name":"dbi services Blog","article_publisher":"https:\/\/www.facebook.com\/dbiservices\/","article_published_time":"2021-08-11T07:24:19+00:00","og_image":[{"width":867,"height":365,"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Client_Statistics_05a.png","type":"image\/png"}],"author":"St\u00e9phane Haby","twitter_card":"summary_large_image","twitter_creator":"@dbiservices","twitter_site":"@dbiservices","twitter_misc":{"Written by":"St\u00e9phane Haby","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\/"},"author":{"name":"St\u00e9phane Haby","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/7980252d7d7a521e285e7c66114cf82a"},"headline":"SQL Server: Using Client Statistics to validate a query regression after a change in the database compatibility level","datePublished":"2021-08-11T07:24:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\/"},"wordCount":394,"commentCount":0,"publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Client_Statistics_05a.png","keywords":["Microsoft","Performance"],"articleSection":["Database"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\/","url":"https:\/\/www.dbi-services.com\/blog\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\/","name":"SQL Server: Using Client Statistics to validate a query regression after a change in the database compatibility level - dbi services Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Client_Statistics_05a.png","datePublished":"2021-08-11T07:24:19+00:00","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Client_Statistics_05a.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Client_Statistics_05a.png","width":867,"height":365},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-using-client-statistics-to-find-the-good-cardinality-estimator-and-compatibility-level-for-a-migrated-database\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"SQL Server: Using Client Statistics to validate a query regression after a change in the database compatibility level"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi services Blog","description":"#BeSharing","publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dbi-services.com\/#organization","name":"dbi services","url":"https:\/\/www.dbi-services.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","width":512,"height":512,"caption":"dbi services"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/dbiservices\/","https:\/\/x.com\/dbiservices","https:\/\/www.linkedin.com\/company\/dbi-services\/","https:\/\/www.youtube.com\/user\/dbiservices"],"description":"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.","email":"info@dbi-services.com","telephone":"+41 32 422 96 00","legalName":"dbi services SA"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/7980252d7d7a521e285e7c66114cf82a","name":"St\u00e9phane Haby","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/08\/STH_web-min-scaled.jpg","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/08\/STH_web-min-scaled.jpg","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/08\/STH_web-min-scaled.jpg","caption":"St\u00e9phane Haby"},"description":"St\u00e9phane Haby has more than 20 years of experience in Microsoft solutions, specializing in the installation, migration, best practices, and performance analysis of Microsoft SQL Server, as well as Microsoft Business Intelligence solutions (SharePoint, Office) and .NET development for the banking sector. A former Microsoft Most Valuable Professional (MVP) and early adopter of Microsoft Team System in France, he has authored several technical articles. He holds Microsoft Certified Solutions Associate (MCSA) and Expert (MCSE) for SQL Server, MCTS, MCITP for SQL Server 2008, and ITIL V3 Foundation certifications. His industry experience covers chemicals and pharma, banking, and financial services.","url":"https:\/\/www.dbi-services.com\/blog\/author\/stephane-haby\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/16603","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=16603"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/16603\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media\/16609"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=16603"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=16603"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=16603"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}