{"id":49052,"date":"2022-12-01T08:00:00","date_gmt":"2022-12-01T16:00:00","guid":{"rendered":""},"modified":"2024-02-08T12:21:09","modified_gmt":"2024-02-08T20:21:09","slug":"cardinality-estimation-feedback-in-sql-server-2022","status":"publish","type":"post","link":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/","title":{"rendered":"Cardinality Estimation Feedback in SQL Server 2022"},"content":{"rendered":"\n<p><em>Part of the\u202f<\/em><a href=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/tag\/sql-server-2022-blogging-series\" target=\"_blank\" rel=\"noreferrer noopener\"><em>SQL Server 2022 blog series<\/em><\/a>.<\/p>\n\n\n\n<p>Cardinality estimation (CE) is a process used by the query optimizer to estimate the number of rows returned by a query or sub-part of a query. These estimates rely on two underlying things: statistics about the data and a set of assumptions\u2014known as the model. The model determines how we interpret statistics and data coming from various sub expressions, and so, for any given set of statistics, different models will arrive at different cardinality estimates.&nbsp;<\/p>\n\n\n<div class=\"wp-block-msxcm-cta-block theme-dark\" data-moray data-bi-an=\"CTA Block\">\n\t<div class=\"card d-block mx-ng mx-md-0\">\n\t\t<div class=\"row no-gutters bg-gray-800 text-white\">\n\n\t\t\t\t\t\t\t<div class=\"col-md-4\">\n\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/PreviewImage-1-1024x683.webp\" class=\"card-img img-object-cover\" alt=\"Database\" srcset=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/PreviewImage-1-1024x683.webp 1024w, https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/PreviewImage-1-300x200.webp 300w, https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/PreviewImage-1-768x512.webp 768w, https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/PreviewImage-1-800x533.webp 800w, https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/PreviewImage-1-400x267.webp 400w, https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/PreviewImage-1.webp 1038w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/>\t\t\t\t<\/div>\n\t\t\t\n\t\t\t<div class=\"d-flex col-md\">\n\t\t\t\t<div class=\"card-body align-self-center p-4 p-md-5\">\n\t\t\t\t\t\n\t\t\t\t\t<h2>SQL Server 2022<\/h2>\n\n\t\t\t\t\t<div class=\"mb-3\">\n\t\t\t\t\t\t<p>The most Azure-enabled release yet, with continued performance, security, and availability innovation.<\/p>\n\t\t\t\t\t<\/div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"link-group\">\n\t\t\t\t\t\t\t<a href=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/sql-server-2022\" class=\"btn btn-link text-decoration-none p-0 text-light-blue\" target=\"_blank\">\n\t\t\t\t\t\t\t\t<span>Learn more<\/span>\n\t\t\t\t\t\t\t\t<span class=\"glyph-append glyph-append-chevron-right glyph-append-xsmall\"><\/span>\n\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t<\/div>\n\n\t\t\t\t\t<\/div>\n\t<\/div>\n<\/div>\n\n\n\n<p>Until <a href=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/sql-server-2022\">SQL Server 2022<\/a>, CE could only have one model. The set of assumptions used was baked into the code of the server, and so whatever model was picked is what was used for all queries. However, we know that not all queries and workloads perform best under one single model. For some queries, the model we use works out well, but for others, a different model would perform better. With CE Feedback in SQL Server 2022, we can now tailor the model used to generate a query play to the specific query.<\/p>\n\n\n\n<p>CE has always had three basic assumptions that comprise the model: independence (or partial independence), uniformity, and containment.&nbsp;These three assumptions determine how we interpret histograms, and they determine how we combine data during joins or in the presence of multiple predicates. In this blog, I will explain these model variants and what they mean in more detail.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"uniformity\">Uniformity<\/h2>\n\n\n\n<p>Let\u2019s begin by discussing uniformity assumption. This assumption is used when interpreting data from the on-disk histograms\u2014abstracted data about the columns being queried. We assume that all data within steps, or buckets, of a histogram is uniformly distributed at an average frequency for that bucket.&nbsp;Thus, when we query data, this allows us to determine the number of rows that satisfy the predicate.&nbsp;<\/p>\n\n\n\n<p>Now, CE Feedback modifies the uniformity assumption only in one special case\u2014that of <em>Row Goal<\/em> queries. These queries look like <em>TOP n,<\/em> or <em>Fast n, <\/em>or <em>IN<\/em>. and there is a special optimization for row goal queries that relies on the independence assumption. Whenever we believe that a particular value occurs at a high enough frequency (based on our interpretation of the histogram using the independence assumption), we choose to do a quick scan of a few pages assuming that we will get enough qualifying rows very quickly. However, if the data is skewed, we may have falsely assumed more qualifying values than were actually present. This means we scan far more pages than expected to get the requisite number of rows.<\/p>\n\n\n\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\">\n<p>CE Feedback can detect such scenarios and turn off the special row goal optimization. If it turns out that the query is indeed faster without this assumption, we keep this change by persisting it in the query store in the form of a query store hint, and the new optimization will be used for future executions of the query.<\/p>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-ad2f72ca wp-block-group-is-layout-flex\">\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-ad2f72ca wp-block-group-is-layout-flex\"><figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture1a.webp\" alt=\"Non-uniform data chart\" class=\"wp-image-49053 webp-format\" style=\"width:280px;height:192px\" srcset=\"\" data-orig-src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture1a.webp\"><\/figure>\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-default\"><img decoding=\"async\" src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture1b.webp\" alt=\"Uniform data chart\" class=\"wp-image-49054 webp-format\" style=\"width:280px;height:192px\" srcset=\"\" data-orig-src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture1b.webp\"><\/figure>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"independence\">Independence<\/h2>\n\n\n\n<p>Consider a where clause with two predicates, combined with an AND. Something like City=\u2019Seattle\u201d AND State=\u2019WA\u2019. Under the model assumption of independence, we would take the selectivity of the individual predicates (City=\u2019Seattle\u2019, State=\u2019WA\u2019) and multiply those probabilities together. Under the model assumption of correlation, we would take the most selective predicate (City=\u2019Seattle\u2019) and use the selectivity of that predicate only to determine the selectivity of the conjunctive clause. There is a third model of partial correlation, in which we multiply the selectivity of the most selective predicate with a weakened selectivity (raised to a power less than 1, to make the selectivity closer to 1) of the successive predicates.&nbsp;<\/p>\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture2-3.webp\" alt=\"Chart showing P1 and P2 independence\" class=\"wp-image-49057 webp-format\" srcset=\"\" data-orig-src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture2-3.webp\"><figcaption class=\"wp-element-caption\"><em><em>Figure 1: Independence. P1 and P2 are independent &#8211; that is, the truth (or falsehood) of P1 tells us nothing about the truth or falsehood of P2.<\/em><\/em><\/figcaption><\/figure>\n\n\n\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\"><figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture3-3.webp\" alt=\"Chart showing partial correlation\" class=\"wp-image-49058 webp-format\" srcset=\"\" data-orig-src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture3-3.webp\"><figcaption class=\"wp-element-caption\"><em>Figure 2: Partial Correlation. In cases where we are evaluating P1 = T and P2 = T, you can see that P1 being true gives a higher likelihood of P2 being true.&nbsp;The cases where P1 is false are greyed out because they do not satisfy P1=T<\/em>.<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\">\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\">\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\"><figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture4-2.webp\" alt=\"Chart showing complete correlation\" class=\"wp-image-49059 webp-format\" srcset=\"\" data-orig-src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture4-2.webp\"><figcaption class=\"wp-element-caption\"><em>Figure 3: Complete correlation.&nbsp;When evaluating P1=T and P2 = T, we can see that anytime P1 is true, P2 is also true (P1 implies P2).<\/em><\/figcaption><\/figure>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<p>CE always starts out with this last model of partial independence (referenced in other places as exponential backoff), but with CE Feedback, we can see if our estimates are too high, meaning the predicates are more independent, or too low, meaning that there is more correlation than expected, and adjust the model used for that query and those predicates accordingly for future executions. If this makes the plan or performance better, we persist this adjustment using a query store hint, and use it for future executions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"containment\">Containment<\/h2>\n\n\n\n<p>The model assumption of containment means that users query data that is actually in the table.&nbsp;Meaning, if there is a column = constant predicate in the table, we assume that the constant actually exists in the table, at the frequency appropriate for where it falls within the histogram. However, we also assume that there is a containment relationship between joins. Basically, we assume that users wouldn\u2019t join two tables together if they didn\u2019t think there would be matches. However, there are two ways of looking at the containment relationship between joins: Base containment, or Simple containment.<\/p>\n\n\n\n<p>Base containment assumes that there is an inherent relationship between the tables participating in a join but doesn\u2019t make assumptions about the filters occurring on top of those tables before the join occurs.&nbsp;A good example might be a table of store sales and a table of store returns. We would assume that all things returned were also sold, but we would not assume that any filtering on the sales or returns tables makes containment more or less likely\u2014we just assume containment at the base table level and scale the size of the estimated result up or down based on the filters in play.<\/p>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-ad2f72ca wp-block-group-is-layout-flex\">\n<div class=\"wp-block-group is-content-justification-center is-nowrap is-layout-flex wp-container-core-group-is-layout-94bc23d7 wp-block-group-is-layout-flex\">\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\"><figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture5a.webp\" alt=\"Chart showing simple containment\" class=\"wp-image-49060 webp-format\" srcset=\"\" data-orig-src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture5a.webp\"><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\"><figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture5b.webp\" alt=\"Chart showing Returns contained in Sales\" class=\"wp-image-49061 webp-format\" srcset=\"\" data-orig-src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture5b.webp\"><\/figure>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<p>Simple containment is a bit different\u2014instead of assuming some inherent relationship between the base tables, it assumes that the filters applied to those tables create a containment relationship.&nbsp;For example, querying for graduating seniors from a specific high school and joining that with a query for athletes in a given zip code.&nbsp;While there is some inherent relationship between the two tables a priori, the filters applied specifically limit and create a containment relationship.&nbsp;<\/p>\n\n\n\n<div class=\"wp-block-group is-content-justification-center is-nowrap is-layout-flex wp-container-core-group-is-layout-94bc23d7 wp-block-group-is-layout-flex\"><figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture6a.webp\" alt=\"Chart showing a join between two tables\" class=\"wp-image-49062 webp-format\" srcset=\"\" data-orig-src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture6a.webp\"><\/figure>\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture6b.webp\" alt=\"Chart showing filters applied\" class=\"wp-image-49063 webp-format\" srcset=\"\" data-orig-src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture6b.webp\"><\/figure>\n<\/div>\n\n\n\n<p>CE starts with the base containment model for all queries. However, if the estimates for the join are \u2018off\u2019 in some way\u2014the incoming estimates are good, the outgoing estimates are bad\u2014we try the alternate containment model. When the query is executed again, we try out the other model, and if it is better, we persist it with a query store hint and use it for future executions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>In summary, CE requires a basic set of assumptions that are used to interpret and combine statistical data about histograms or sub-parts of a query. Those assumptions work well for some queries, and less well for others. In SQL Server 2022, we have introduced a method of CE Feedback which adjusts those assumptions in a per-query way, based on actual performance of the query over time.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"learn-more\">Learn more<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>See&nbsp;<a href=\"https:\/\/docs.microsoft.com\/sql\/sql-server\/what-s-new-in-sql-server-2022?view=sql-server-ver16\" target=\"_blank\" rel=\"noreferrer noopener\">what\u2019s new in SQL Server 2022<\/a>.<\/li>\n\n\n\n<li>Try out the Microsoft Learn&nbsp;<a href=\"https:\/\/aka.ms\/learnsqlserver2022\" target=\"_blank\" rel=\"noreferrer noopener\">SQL Server 2022 module<\/a>&nbsp;and the&nbsp;<a href=\"https:\/\/aka.ms\/sql2022workshop\" target=\"_blank\" rel=\"noreferrer noopener\">SQL Server 2022 workshop<\/a>.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In SQL Server 2022, we have introduced a method of CE Feedback based on actual performance of the query over time.<\/p>\n","protected":false},"author":6194,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false,"_classifai_error":"","_classifai_text_to_speech_error":"","footnotes":""},"post_tag":[5278],"product":[5227,3645],"content-type":[2448],"topic":[],"coauthors":[5132],"class_list":["post-49052","post","type-post","status-publish","format-standard","hentry","tag-sql-server-2022-blogging-series","product-sql","product-sql-server-2022","content-type-updates","review-flag-1-1593580431-15","review-flag-2-1593580436-981","review-flag-3-1593580441-293","review-flag-alway-1593580309-407","review-flag-new-1593580247-437"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Cardinality Estimation Feedback in SQL Server 2022 - Microsoft SQL Server Blog<\/title>\n<meta name=\"description\" content=\"In SQL Server 2022, we have introduced a method of CE Feedback which adjusts those assumptions in a per-query way. Learn more.\" \/>\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.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cardinality Estimation Feedback in SQL Server 2022 - Microsoft SQL Server Blog\" \/>\n<meta property=\"og:description\" content=\"In SQL Server 2022, we have introduced a method of CE Feedback which adjusts those assumptions in a per-query way. Learn more.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/\" \/>\n<meta property=\"og:site_name\" content=\"Microsoft SQL Server Blog\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/sqlserver\" \/>\n<meta property=\"article:published_time\" content=\"2022-12-01T16:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-08T20:21:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture1a.png\" \/>\n<meta name=\"author\" content=\"Kate Smith\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@SQLServer\" \/>\n<meta name=\"twitter:site\" content=\"@SQLServer\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kate Smith\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 min read\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/\"},\"author\":[{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/author\/kate-smith\/\",\"@type\":\"Person\",\"@name\":\"Kate Smith\"}],\"headline\":\"Cardinality Estimation Feedback in SQL Server 2022\",\"datePublished\":\"2022-12-01T16:00:00+00:00\",\"dateModified\":\"2024-02-08T20:21:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/\"},\"wordCount\":1235,\"publisher\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture1a.png\",\"keywords\":[\"SQL Server 2022 Blogging Series\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/\",\"name\":\"Cardinality Estimation Feedback in SQL Server 2022 - Microsoft SQL Server Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture1a.png\",\"datePublished\":\"2022-12-01T16:00:00+00:00\",\"dateModified\":\"2024-02-08T20:21:09+00:00\",\"description\":\"In SQL Server 2022, we have introduced a method of CE Feedback which adjusts those assumptions in a per-query way. Learn more.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/#primaryimage\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture1a.webp\",\"contentUrl\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture1a.webp\",\"width\":280,\"height\":192,\"caption\":\"chart, bar chart, histogram\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cardinality Estimation Feedback in SQL Server 2022\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#website\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/\",\"name\":\"Microsoft SQL Server Blog\",\"description\":\"Official News from Microsoft\u2019s Information Platform\",\"publisher\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#organization\",\"name\":\"Microsoft SQL Server Blog\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2019\/08\/Microsoft-Logo.png\",\"contentUrl\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2019\/08\/Microsoft-Logo.png\",\"width\":259,\"height\":194,\"caption\":\"Microsoft SQL Server Blog\"},\"image\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"http:\/\/www.facebook.com\/sqlserver\",\"https:\/\/x.com\/SQLServer\",\"https:\/\/www.youtube.com\/user\/MSCloudOS\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cardinality Estimation Feedback in SQL Server 2022 - Microsoft SQL Server Blog","description":"In SQL Server 2022, we have introduced a method of CE Feedback which adjusts those assumptions in a per-query way. Learn more.","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.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/","og_locale":"en_US","og_type":"article","og_title":"Cardinality Estimation Feedback in SQL Server 2022 - Microsoft SQL Server Blog","og_description":"In SQL Server 2022, we have introduced a method of CE Feedback which adjusts those assumptions in a per-query way. Learn more.","og_url":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/","og_site_name":"Microsoft SQL Server Blog","article_publisher":"http:\/\/www.facebook.com\/sqlserver","article_published_time":"2022-12-01T16:00:00+00:00","article_modified_time":"2024-02-08T20:21:09+00:00","og_image":[{"url":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture1a.png","type":"","width":"","height":""}],"author":"Kate Smith","twitter_card":"summary_large_image","twitter_creator":"@SQLServer","twitter_site":"@SQLServer","twitter_misc":{"Written by":"Kate Smith","Est. reading time":"5 min read"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/#article","isPartOf":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/"},"author":[{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/author\/kate-smith\/","@type":"Person","@name":"Kate Smith"}],"headline":"Cardinality Estimation Feedback in SQL Server 2022","datePublished":"2022-12-01T16:00:00+00:00","dateModified":"2024-02-08T20:21:09+00:00","mainEntityOfPage":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/"},"wordCount":1235,"publisher":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#organization"},"image":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/#primaryimage"},"thumbnailUrl":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture1a.png","keywords":["SQL Server 2022 Blogging Series"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/","url":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/","name":"Cardinality Estimation Feedback in SQL Server 2022 - Microsoft SQL Server Blog","isPartOf":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/#primaryimage"},"image":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/#primaryimage"},"thumbnailUrl":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture1a.png","datePublished":"2022-12-01T16:00:00+00:00","dateModified":"2024-02-08T20:21:09+00:00","description":"In SQL Server 2022, we have introduced a method of CE Feedback which adjusts those assumptions in a per-query way. Learn more.","breadcrumb":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/#primaryimage","url":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture1a.webp","contentUrl":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2022\/11\/Picture1a.webp","width":280,"height":192,"caption":"chart, bar chart, histogram"},{"@type":"BreadcrumbList","@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2022\/12\/01\/cardinality-estimation-feedback-in-sql-server-2022\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/"},{"@type":"ListItem","position":2,"name":"Cardinality Estimation Feedback in SQL Server 2022"}]},{"@type":"WebSite","@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#website","url":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/","name":"Microsoft SQL Server Blog","description":"Official News from Microsoft\u2019s Information Platform","publisher":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#organization","name":"Microsoft SQL Server Blog","url":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2019\/08\/Microsoft-Logo.png","contentUrl":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2019\/08\/Microsoft-Logo.png","width":259,"height":194,"caption":"Microsoft SQL Server Blog"},"image":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#\/schema\/logo\/image\/"},"sameAs":["http:\/\/www.facebook.com\/sqlserver","https:\/\/x.com\/SQLServer","https:\/\/www.youtube.com\/user\/MSCloudOS"]}]}},"msxcm_display_generated_audio":false,"msxcm_animated_featured_image":null,"_links":{"self":[{"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/posts\/49052","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/users\/6194"}],"replies":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/comments?post=49052"}],"version-history":[{"count":0,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/posts\/49052\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/media?parent=49052"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/post_tag?post=49052"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/product?post=49052"},{"taxonomy":"content-type","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/content-type?post=49052"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/topic?post=49052"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/coauthors?post=49052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}