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

Applies to: SQL Server 2012 DeveloperSQL Server 2012 EnterpriseSQL Server 2012 Standard


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:


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