Summary

When Microsoft SQL Server creates or updates statistics, if a sampling rate isn't manually specified, SQL Server will calculate a default sampling rate. Depending on the real distribution of data in the underlying table, the default sampling rate may not accurately represent the data distribution. This may cause degradation of query plan efficiency.

To improve this scenario, a database administrator can choose to manually update statistics by using a fixed sampling rate that can better represent the distribution of data. However, a subsequent Automatic Update Statistics operation will reset back to the default sampling rate, and possibly reintroduce degradation of query plan efficiency.

This enhancement allows the fixed sampling rate to be persisted across subsequent manual or automatic update statistics operations.

Resolution

This update introduces a new keyword PERSIST_SAMPLE_PERCENT = { ON | OFF } that's an extension to the existing CREATE/UPDATE STATISTICS Transact-SQL. The keyword will indicate SQL Server to lock the sampling rate (provided when it's created or updated) for future use.

For more information about statistics, see Create Statistics.

The feature is available in the following cumulative updates for SQL Server:

Cumulative Update 1 for SQL Server 2017

Cumulative Update 4 for SQL Server 2016 SP1

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:

Latest cumulative update for SQL Server 2017

Latest cumulative update for SQL Server 2016

Status

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

References

Learn about the terminologythat Microsoft uses to describe software updates.

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

What affected your experience?

Thank you for your feedback!

×