{"id":1182,"date":"2025-08-29T09:00:00","date_gmt":"2025-08-29T14:00:00","guid":{"rendered":"https:\/\/www.sqltabletalk.com\/?p=1182"},"modified":"2025-08-28T22:24:01","modified_gmt":"2025-08-29T03:24:01","slug":"sql-server-2022-legacy-ce-bad-idea","status":"publish","type":"post","link":"https:\/\/www.sqltabletalk.com\/?p=1182","title":{"rendered":"Why staying on the legacy Cardinality Estimator in SQL Server 2022 is a bad idea"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>Cardinality estimation (CE) is how the optimizer predicts the number of rows that will flow through each operator in a plan. Those estimates drive cost, join choices, memory grants, and ultimately latency and resource usage. SQL Server has shipped multiple CE models over time. The pre-2014 model\u2014commonly called the legacy CE\u2014dates back to SQL Server 7.0. Starting in SQL Server 2014, Microsoft introduced a new CE and has continued refining it in later releases, including SQL Server 2022. Keeping the legacy CE turned on in SQL Server 2022 is usually the wrong long-term choice.<\/p>\n<h2>A quick refresher: what \u201clegacy CE\u201d actually means<\/h2>\n<p>The legacy CE (version 70) is built on four simplifying assumptions: independence (filters on different columns are independent), uniformity (values are evenly distributed), simple containment (joins assume only matching values exist), and inclusion (filtered constants exist in the histogram). These assumptions were reasonable for older, simpler workloads, but they are often inaccurate on today\u2019s skewed and correlated datasets.<\/p>\n<p>SQL Server 2014 introduced a redesigned CE (versions 120+) that changed key assumptions\u2014most notably modeling correlation across predicates and using base containment for joins. The goal is more realistic estimates across a broader range of modern OLTP and analytics workloads.<\/p>\n<p>You can still force the legacy model globally or per database, and you can force it per query. Execution plans expose the CE model in the <code>CardinalityEstimationModelVersion<\/code> plan property.<\/p>\n<h2>What changed in SQL Server 2022<\/h2>\n<p>SQL Server 2022 (compatibility level 160) adds Cardinality Estimation feedback as part of Intelligent Query Processing. The engine can observe large estimate errors on repeating queries and automatically adjust estimation behavior for those queries, persisting corrections via Query Store so future executions get better estimates. CE feedback is designed to operate with the modern CE pipeline; if you compile queries under the legacy CE globally, you reduce or eliminate the benefit of this feature on those queries.<\/p>\n<blockquote><p>In short: CE feedback helps the optimizer \u201clearn\u201d better estimates over time for repeating problem queries. Sticking to legacy CE prevents most of that benefit.<\/p><\/blockquote>\n<h2>Why staying on legacy CE in SQL Server 2022 is a bad idea<\/h2>\n<h3>1) You opt out of 2022\u2019s self-healing capabilities<\/h3>\n<p>CE feedback is a 2022 feature that mitigates bad estimates by adjusting model behavior per query. Running the legacy CE globally means fewer queries can take advantage of that automatic correction, leaving more persistent misestimates and more manual triage for you.<\/p>\n<h3>2) You cement outdated assumptions that misestimate on modern data<\/h3>\n<p>Independence and uniformity assumptions often mispredict row counts for multi-predicate filters, skewed distributions, and heterogeneous join keys. Misestimates cascade into poor join choices, over\/under memory grants, spills, unnecessary scans, and under- or over-parallelization.<\/p>\n<h3>3) You accumulate technical debt that compounds across upgrades<\/h3>\n<p>The longer you run on legacy CE, the more code, indexes, and operational habits accrete around those estimates. When you finally move to the current CE, you face a bigger behavioral delta, more regression risk, and a larger validation effort. Deferring only increases the blast radius later.<\/p>\n<h3>4) You introduce operational fragility (and confusion)<\/h3>\n<p>Instance or database toggles (and trace flags) create hidden state. Changing CE settings does not retroactively recompile every cached plan; mixed caches are common during transitions. That leads to inconsistent performance and hard-to-explain plan differences until caches stabilize or you force recompiles.<\/p>\n<h3>5) You deny most queries a better default<\/h3>\n<p>The modern CE is the default for a reason: across broad workloads it improves average plan quality. A small subset of queries can regress, but the right response is to keep the modern CE globally and target the exceptions with per-query mitigations\u2014not to anchor the entire database to the legacy model.<\/p>\n<h3>6) You spend engineering time fighting the optimizer<\/h3>\n<p>Teams on legacy CE often compensate with brittle hints, extra indexes, or hand-tuned plan shapes that mask estimation errors. That d\u00e9tour increases maintenance, hurts concurrency, and can become invalid as data evolves. Let the modern CE and IQP features do their work; reserve manual interventions for true edge cases.<\/p>\n<h3>7) You complicate environment parity and supportability<\/h3>\n<p>Different CE settings across dev, test, and prod make reproduction and root cause analysis harder. Many vendor and platform troubleshooting guides assume modern CE behavior; staying on legacy CE increases time-to-resolution when performance issues arise.<\/p>\n<h2>\u201cBut I can still use modern features with legacy CE, right?\u201d<\/h2>\n<p>Partly. If you run at compatibility level 160 and only flip legacy CE on, you still retain many optimizer and IQP features tied to compatibility level. However, you continue to inherit legacy estimation patterns by default, and you undercut CE feedback\u2019s ability to help. You also keep living with legacy CE\u2019s characteristic memory grants and join choices, which are frequent root causes of spills and regressions.<\/p>\n<h2>A practical, low-risk path off legacy CE<\/h2>\n<ol>\n<li>Use the highest compatibility level and disable legacy CE in a safe environment (pre-prod). Measure top statements with Query Store before and after.<\/li>\n<li>Keep modern CE by default in production once validated.<\/li>\n<li>Surgically mitigate regressors using precise levers:\n<ul>\n<li>Per-query hint to force legacy or default CE on a single statement.<\/li>\n<li>Query Store hints to persist the same effect without changing code.<\/li>\n<li><code>QUERY_OPTIMIZER_COMPATIBILITY_LEVEL_n<\/code> to emulate an older optimizer for one query, when required.<\/li>\n<\/ul>\n<\/li>\n<li>Let SQL Server 2022\u2019s CE feedback work on the rest of the workload so repeated queries with large estimate errors self-correct over time.<\/li>\n<\/ol>\n<h2>Additional points that are easy to overlook<\/h2>\n<ul>\n<li>Plan provenance matters. During transitions, check the plan property <code>CardinalityEstimationModelVersion<\/code> to confirm which CE compiled each plan.<\/li>\n<li>Prefer database-scoped configs and Query Store hints over trace flags. They\u2019re easier to reason about and safer for long-term maintainability.<\/li>\n<li>CE continues to evolve. Estimation improvements and optimizer behaviors accumulate with compatibility levels (130, 140, 150, 160). Staying on legacy CE means you miss those cumulative gains.<\/li>\n<li>Avoid hidden drift between environments. Standardize on modern CE globally and document any query-level exceptions.<\/li>\n<li>Recompilation strategy matters. When changing CE settings, plan for controlled recompiles (or cache clears) to avoid long periods of mixed behavior.<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>The legacy CE is a valuable temporary escape hatch during upgrades\u2014but a poor long-term strategy on SQL Server 2022. It locks you into outdated assumptions, prevents the engine from correcting estimate errors automatically, increases operational complexity, and builds technical debt that becomes more expensive to unwind later. Keep the modern CE on by default; use Query Store and per-query hints to isolate the few regressors. That approach yields better average plan quality today and a smoother upgrade path tomorrow.<\/p>\n<h2>References:<\/h2>\n<ul>\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/relational-databases\/performance\/cardinality-estimation-sql-server?view=sql-server-ver17\" target=\"_blank\" rel=\"noopener\">Cardinality Estimation (SQL Server)<\/a> \u2014 model assumptions, versions, assessment guidance.<\/li>\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/t-sql\/statements\/alter-database-scoped-configuration-transact-sql?view=sql-server-ver17\" target=\"_blank\" rel=\"noopener\">ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL)<\/a> \u2014 LEGACY_CARDINALITY_ESTIMATION and related settings; relationship to trace flag 9481.<\/li>\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/t-sql\/queries\/hints-transact-sql-query?view=sql-server-ver17\" target=\"_blank\" rel=\"noopener\">Query Hints (Transact-SQL)<\/a> \u2014 USE HINT(&#8216;FORCE_LEGACY_CARDINALITY_ESTIMATION&#8217;), USE HINT(&#8216;FORCE_DEFAULT_CARDINALITY_ESTIMATION&#8217;), and USE HINT(&#8216;QUERY_OPTIMIZER_COMPATIBILITY_LEVEL_n&#8217;).<\/li>\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/relational-databases\/performance\/query-store-hints?view=sql-server-ver17\" target=\"_blank\" rel=\"noopener\">Query Store hints<\/a> \u2014 persisting hint behavior without changing application code.<\/li>\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/relational-databases\/performance\/intelligent-query-processing-cardinality-estimation-feedback?view=sql-server-ver17\" target=\"_blank\" rel=\"noopener\">Cardinality Estimation feedback (SQL Server 2022)<\/a> \u2014 IQP feature overview and behavior.<\/li>\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/t-sql\/statements\/alter-database-transact-sql-compatibility-level?view=sql-server-ver17\" target=\"_blank\" rel=\"noopener\">Database compatibility levels (SQL Server)<\/a> \u2014 optimizer behavior by level, including 160.<\/li>\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/troubleshoot\/sql\/database-engine\/performance\/decreased-query-perf-after-upgrade\" target=\"_blank\" rel=\"noopener\">Execution plan properties<\/a> \u2014 CardinalityEstimationModelVersion and related metadata.<\/li>\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/t-sql\/database-console-commands\/dbcc-traceon-trace-flags-transact-sql?view=sql-server-ver17\" target=\"_blank\" rel=\"noopener\">Trace Flags (Transact-SQL)<\/a> \u2014 background on 9481 (legacy CE) and related flags.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Cardinality estimation (CE) is how the optimizer predicts the number of rows that will flow through each operator in a plan. Those estimates drive cost, join choices, memory grants, and ultimately latency and resource usage. SQL Server has shipped multiple CE models over time. The pre-2014 model\u2014commonly called the legacy CE\u2014dates back to SQL Server 7.0. Starting in SQL Server 2014, Microsoft introduced a new CE and has continued refining it in later releases, including SQL Server 2022. Keeping the legacy CE turned on in SQL Server 2022 is usually the wrong long-term choice.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[82,5,400,40],"tags":[629,631,403,317,630,90,632,119,396],"class_list":["post-1182","post","type-post","status-publish","format-standard","hentry","category-database-configuration","category-performance","category-query-store","category-sql-server-2022","tag-cardinality-estimator","tag-ce-feedback","tag-database-performance","tag-intelligent-query-processing","tag-legacy-ce","tag-query-optimizer","tag-query-tuning","tag-sql-server-2022","tag-sql-server-upgrade"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Why staying on the legacy Cardinality Estimator in SQL Server 2022 is a bad idea - SQL Table Talk<\/title>\n<meta name=\"description\" content=\"Cardinality estimation (CE) is how the optimizer predicts the number of rows that will flow through each operator in a plan. Those estimates drive cost, join choices, memory grants, and ultimately latency and resource usage. SQL Server has shipped multiple CE models over time. The pre-2014 model\u2014commonly called the legacy CE\u2014dates back to SQL Server 7.0. Starting in SQL Server 2014, Microsoft introduced a new CE and has continued refining it in later releases, including SQL Server 2022. Keeping the legacy CE turned on in SQL Server 2022 is usually the wrong long-term choice.\" \/>\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.sqltabletalk.com\/?p=1182\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Why staying on the legacy Cardinality Estimator in SQL Server 2022 is a bad idea - SQL Table Talk\" \/>\n<meta property=\"og:description\" content=\"Cardinality estimation (CE) is how the optimizer predicts the number of rows that will flow through each operator in a plan. Those estimates drive cost, join choices, memory grants, and ultimately latency and resource usage. SQL Server has shipped multiple CE models over time. The pre-2014 model\u2014commonly called the legacy CE\u2014dates back to SQL Server 7.0. Starting in SQL Server 2014, Microsoft introduced a new CE and has continued refining it in later releases, including SQL Server 2022. Keeping the legacy CE turned on in SQL Server 2022 is usually the wrong long-term choice.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqltabletalk.com\/?p=1182\" \/>\n<meta property=\"og:site_name\" content=\"SQL Table Talk\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-29T14:00:00+00:00\" \/>\n<meta name=\"author\" content=\"Stephen Planck\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Stephen Planck\" \/>\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\":\"Article\",\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=1182#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=1182\"},\"author\":{\"name\":\"Stephen Planck\",\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0\"},\"headline\":\"Why staying on the legacy Cardinality Estimator in SQL Server 2022 is a bad idea\",\"datePublished\":\"2025-08-29T14:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=1182\"},\"wordCount\":1164,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0\"},\"keywords\":[\"cardinality estimator\",\"CE feedback\",\"Database Performance\",\"Intelligent Query Processing\",\"legacy CE\",\"Query Optimizer\",\"query tuning\",\"SQL Server 2022\",\"SQL Server Upgrade\"],\"articleSection\":[\"Database Configuration\",\"Performance\",\"Query Store\",\"SQL Server 2022\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.sqltabletalk.com\/?p=1182#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=1182\",\"url\":\"https:\/\/www.sqltabletalk.com\/?p=1182\",\"name\":\"Why staying on the legacy Cardinality Estimator in SQL Server 2022 is a bad idea - SQL Table Talk\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/#website\"},\"datePublished\":\"2025-08-29T14:00:00+00:00\",\"description\":\"Cardinality estimation (CE) is how the optimizer predicts the number of rows that will flow through each operator in a plan. Those estimates drive cost, join choices, memory grants, and ultimately latency and resource usage. SQL Server has shipped multiple CE models over time. The pre-2014 model\u2014commonly called the legacy CE\u2014dates back to SQL Server 7.0. Starting in SQL Server 2014, Microsoft introduced a new CE and has continued refining it in later releases, including SQL Server 2022. Keeping the legacy CE turned on in SQL Server 2022 is usually the wrong long-term choice.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=1182#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqltabletalk.com\/?p=1182\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=1182#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqltabletalk.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Why staying on the legacy Cardinality Estimator in SQL Server 2022 is a bad idea\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqltabletalk.com\/#website\",\"url\":\"https:\/\/www.sqltabletalk.com\/\",\"name\":\"SQL Table Talk\",\"description\":\"Breaking Down SQL Server, One Post at a Time.\",\"publisher\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqltabletalk.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0\",\"name\":\"Stephen Planck\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/64181114edc3de3d99072c049bcec024f025c9536dc89fc8ff1bac58976ca81e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/64181114edc3de3d99072c049bcec024f025c9536dc89fc8ff1bac58976ca81e?s=96&d=mm&r=g\",\"caption\":\"Stephen Planck\"},\"logo\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/dexterwiki.com\",\"https:\/\/www.linkedin.com\/in\/stephen-planck-4611b692?trk=people-guest_people_search-card&challengeId=AQErf8gbBmcVMwAAAYsyIsxO-0UvU8z7cHrBpZoo_n3xt9qEKpRN5B_jd_LmAMu-OfeArkQ7GDjobJ2uRoQQV35EQdh_rR6kxA&submissionId=09de7067-c335-8e17-40b8-8dc32b60ed6c&challengeSource=AgEcUCw35zpPmAAAAYsyI4vAWhJTV7Nt4vZYKc3V1qiDBpCkKgUvtlOBgYXcE84&challegeType=AgE_wZiTT09IAQAAAYsyI4vDmNvbZIYe6XHju5V2bXVvM3IVxnJslgY&memberId=AgESFTkUShzs_gAAAYsyI4vGYk0Gic1uc5kB6cKOABA26Gw&recognizeDevice=AgHdSZyUSI5CEwAAAYsyI4vKd_koF9JgpsCJShT8QfbK1QMiv8SI\",\"https:\/\/www.youtube.com\/linuxmate\"],\"url\":\"https:\/\/www.sqltabletalk.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Why staying on the legacy Cardinality Estimator in SQL Server 2022 is a bad idea - SQL Table Talk","description":"Cardinality estimation (CE) is how the optimizer predicts the number of rows that will flow through each operator in a plan. Those estimates drive cost, join choices, memory grants, and ultimately latency and resource usage. SQL Server has shipped multiple CE models over time. The pre-2014 model\u2014commonly called the legacy CE\u2014dates back to SQL Server 7.0. Starting in SQL Server 2014, Microsoft introduced a new CE and has continued refining it in later releases, including SQL Server 2022. Keeping the legacy CE turned on in SQL Server 2022 is usually the wrong long-term choice.","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.sqltabletalk.com\/?p=1182","og_locale":"en_US","og_type":"article","og_title":"Why staying on the legacy Cardinality Estimator in SQL Server 2022 is a bad idea - SQL Table Talk","og_description":"Cardinality estimation (CE) is how the optimizer predicts the number of rows that will flow through each operator in a plan. Those estimates drive cost, join choices, memory grants, and ultimately latency and resource usage. SQL Server has shipped multiple CE models over time. The pre-2014 model\u2014commonly called the legacy CE\u2014dates back to SQL Server 7.0. Starting in SQL Server 2014, Microsoft introduced a new CE and has continued refining it in later releases, including SQL Server 2022. Keeping the legacy CE turned on in SQL Server 2022 is usually the wrong long-term choice.","og_url":"https:\/\/www.sqltabletalk.com\/?p=1182","og_site_name":"SQL Table Talk","article_published_time":"2025-08-29T14:00:00+00:00","author":"Stephen Planck","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Stephen Planck","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sqltabletalk.com\/?p=1182#article","isPartOf":{"@id":"https:\/\/www.sqltabletalk.com\/?p=1182"},"author":{"name":"Stephen Planck","@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0"},"headline":"Why staying on the legacy Cardinality Estimator in SQL Server 2022 is a bad idea","datePublished":"2025-08-29T14:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.sqltabletalk.com\/?p=1182"},"wordCount":1164,"commentCount":0,"publisher":{"@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0"},"keywords":["cardinality estimator","CE feedback","Database Performance","Intelligent Query Processing","legacy CE","Query Optimizer","query tuning","SQL Server 2022","SQL Server Upgrade"],"articleSection":["Database Configuration","Performance","Query Store","SQL Server 2022"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.sqltabletalk.com\/?p=1182#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.sqltabletalk.com\/?p=1182","url":"https:\/\/www.sqltabletalk.com\/?p=1182","name":"Why staying on the legacy Cardinality Estimator in SQL Server 2022 is a bad idea - SQL Table Talk","isPartOf":{"@id":"https:\/\/www.sqltabletalk.com\/#website"},"datePublished":"2025-08-29T14:00:00+00:00","description":"Cardinality estimation (CE) is how the optimizer predicts the number of rows that will flow through each operator in a plan. Those estimates drive cost, join choices, memory grants, and ultimately latency and resource usage. SQL Server has shipped multiple CE models over time. The pre-2014 model\u2014commonly called the legacy CE\u2014dates back to SQL Server 7.0. Starting in SQL Server 2014, Microsoft introduced a new CE and has continued refining it in later releases, including SQL Server 2022. Keeping the legacy CE turned on in SQL Server 2022 is usually the wrong long-term choice.","breadcrumb":{"@id":"https:\/\/www.sqltabletalk.com\/?p=1182#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqltabletalk.com\/?p=1182"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqltabletalk.com\/?p=1182#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqltabletalk.com\/"},{"@type":"ListItem","position":2,"name":"Why staying on the legacy Cardinality Estimator in SQL Server 2022 is a bad idea"}]},{"@type":"WebSite","@id":"https:\/\/www.sqltabletalk.com\/#website","url":"https:\/\/www.sqltabletalk.com\/","name":"SQL Table Talk","description":"Breaking Down SQL Server, One Post at a Time.","publisher":{"@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqltabletalk.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0","name":"Stephen Planck","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/64181114edc3de3d99072c049bcec024f025c9536dc89fc8ff1bac58976ca81e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/64181114edc3de3d99072c049bcec024f025c9536dc89fc8ff1bac58976ca81e?s=96&d=mm&r=g","caption":"Stephen Planck"},"logo":{"@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/dexterwiki.com","https:\/\/www.linkedin.com\/in\/stephen-planck-4611b692?trk=people-guest_people_search-card&challengeId=AQErf8gbBmcVMwAAAYsyIsxO-0UvU8z7cHrBpZoo_n3xt9qEKpRN5B_jd_LmAMu-OfeArkQ7GDjobJ2uRoQQV35EQdh_rR6kxA&submissionId=09de7067-c335-8e17-40b8-8dc32b60ed6c&challengeSource=AgEcUCw35zpPmAAAAYsyI4vAWhJTV7Nt4vZYKc3V1qiDBpCkKgUvtlOBgYXcE84&challegeType=AgE_wZiTT09IAQAAAYsyI4vDmNvbZIYe6XHju5V2bXVvM3IVxnJslgY&memberId=AgESFTkUShzs_gAAAYsyI4vGYk0Gic1uc5kB6cKOABA26Gw&recognizeDevice=AgHdSZyUSI5CEwAAAYsyI4vKd_koF9JgpsCJShT8QfbK1QMiv8SI","https:\/\/www.youtube.com\/linuxmate"],"url":"https:\/\/www.sqltabletalk.com\/?author=1"}]}},"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/posts\/1182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1182"}],"version-history":[{"count":1,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/posts\/1182\/revisions"}],"predecessor-version":[{"id":1183,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/posts\/1182\/revisions\/1183"}],"wp:attachment":[{"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}