Beyond Statistics Histogram Part 4 – Significant Performance Regression in SQL Server 2014

In the previous articles we’ve covered differences in estimations between the old and new CE related to queries that use predicates with literals which values are beyond the statistics histogram. We saw some issues with key ascending columns in SQL Server 2012 which can be solved with the trace flags 2389, 2390 and 4139. And […]

Beyond Statistics Histogram – Part 3 (TF 2389 feat. TF 4139)

In the previous article we’ve shown how can we use TF 2390 to handle queries with literals beyond statistics histogram in SQL Server 2012. We saw that SQL Server creates some statistics on the fly for all columns used in filter expressions. If we would enable trace flag on the instance level that means that […]

Beyond Statistics Histogram – Part 2 (TF 2390)

In the previous article of this series we introduced the problem with queries using literals which are beyond statistics histogram, but exist in the table. We saw that this can be a serious problem in large tables in SQL Server 2012. We saw also that SQL Server 2014 handles it better. In this article we’ll […]

Beyond Statistics Histogram – Part 1

In this article I will start to examine estimations and execution plans for queries that compare values in columns with literal values which are beyond the statistics histogram for that column. The problem is also known as key ascending column statistics problem. As in previous posts we remain here conservative regarding sample tables. We’ll create […]

A Funny Bug with New CE or Introduction to Out-of-Histogram Estimations

Since the release of SQL Server 2014 you can find several articles and blog posts about the changes in the new redesigned cardinality estimator. An excellent and detailed guide about the changes in the new CE you can find in the white paper Optimizing Your Query Plans with the SQL Server 2014 Cardinality Estimator. Almost […]

New Cardinality Estimator Part 8 – Bug No. 2

In this article I will describe another query pattern where new CE in SQL Server 2014 brings significant regression. And, similar to the case in this post I would interpret the behavior of new cardinality estimator in this case as a bug, too. Let’s recreate our usual sample table and populate it this time with […]

New Cardinality Estimator Part 7 – Single Table, Multiple Predicates and Trace Flags

This week I have got a question regarding my post New Cardinality Estimator Part 4 – Single Table and Multiple Predicates. The question was about possibilities to affect the estimation with multiple predicates done by new cardinality estimator. To demonstrates these possibilities we will use again the AdventureWorks2012 database and the SalesOrderHeader table. SQL Server […]

New Cardinality Estimator Part 5 – Bug?

In this article I will describe a case which is not properly handled by the new cardinality estimator, introduced in SQL Server 2014 CTP2. The discrepancy between estimated and actual values is significant, generated execution plans are sub-optimal and execution details are 5 – 50x worst compared to the old CE plans,. Since performance regression is significant […]

New Cardinality Estimator Part 4 – Single Table and Multiple Predicates

In this article I will explore changes in new CE related to column correlation. As mentioned in my first article about new CE, this change is announced in the paper Testing Cardinality Estimation Models in SQL Server. For this article we will query the table Person.Person from the AdventureWorks2012 database. At the beginning let’s execute […]

New Cardinality Estimator Part 3 – Single Table And One Predicate

In this article I will try to find out is there any change in cardinality estimation in a very simple case of querying a single table with a single predicate with the equal operator (i.e. SELECT * FROM T WHERE col = some_value). Since this is a very simple case I don’t expect significant changes. […]