SQL Server sample Update of Statistics misses highest RANGE_HI_KEY on ascending key column
Should SQL Server not identify the highest value for that key and use that as the maximum RANGE_HI_KEY? Or is this just one of the limits of update without using FULLSCAN?


It's a limitation of the current implementation of sampled statistics. As it stands, sampled statistics collection uses TABLESAMPLE SYSTEM, which uses an allocation-order scan and chooses pages from the scan to sample. Only chosen pages contribute to the histogram.

Since the scan is allocation-ordered (rather than index-ordered), there is no way to give preference to the first and last pages in key order.

For more information see this related question:

How does sampling work when updating statistics?

and my article, Allocation Order Scans

For workarounds, see Statistics on Ascending Columns by Fabiano Amorim