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

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).
This issue was first fixed in the following cumulative updates for SQL Server:

About cumulative updates for SQL Server

Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:

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

Article ID: 2952101 - Last Review: 08/31/2016 18:11:00 - Revision: 4.0

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

  • kbqfe kbfix kbexpertiseadvanced kbsurveynew KB2952101