FIX: Poor cardinality estimation when the ascending key column is branded as stationary in SQL Server

Symptoms

Assume that you try to insert values into the leading index column in Microsoft SQL Server 2012 or SQL Server 2014. When fewer than 90 percent of the inserted rows have values that are beyond the highest RANGE_HI_KEY value in the histogram, the column is considered stationary instead of ascending. Therefore, the ascending key is not detected, and trace flags 2389 and 2390 that are usually used to fix the ascending keys problem do not work. This causes poor cardinality estimation when you use predicates that are beyond the RANGE_HI_KEY value of the existing statistics.

Note When you apply this cumulative update, you should enable trace flag 4139. This causes SQL Server to always amend the histogram in the described scenario regardless of the leading column status (ascending, descending, or stationary).

Resolution

This issue was first fixed in the following cumulative updates for SQL Server:
About cumulative updates for SQL Server

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Properties

Article ID: 2952101 - Last Review: Aug 31, 2016 - Revision: 1

Microsoft SQL Server 2012 Service Pack 1, Microsoft SQL Server 2012 Developer, Microsoft SQL Server 2012 Developer, Microsoft SQL Server 2012 Enterprise, Microsoft SQL Server 2012 Enterprise, Microsoft SQL Server 2012 Standard, Microsoft SQL Server 2012 Standard, Microsoft SQL Server 2014 Developer, Microsoft SQL Server 2014 Developer, Microsoft SQL Server 2014 Developer, Microsoft SQL Server 2014 Developer, Microsoft SQL Server 2014 Enterprise, Microsoft SQL Server 2014 Enterprise, Microsoft SQL Server 2014 Enterprise, Microsoft SQL Server 2014 Enterprise, Microsoft SQL Server 2014 Standard, Microsoft SQL Server 2014 Standard, Microsoft SQL Server 2014 Standard, Microsoft SQL Server 2014 Standard, Microsoft SQL Server 2012 Service Pack 2, Microsoft SQL Server 2012 Developer, Microsoft SQL Server 2012 Developer, Microsoft SQL Server 2012 Enterprise, Microsoft SQL Server 2012 Enterprise, Microsoft SQL Server 2012 Standard, Microsoft SQL Server 2012 Standard

Feedback