Skip to content Skip to sidebar Skip to footer

Why Are These Sql Server Statistics Outdated, When It's Set To Auto-update?

We have a SQL Server 2012 instance, with auto-statitics set to ON for the DB: But then i ran a query to check some statistics, and some haven't been updated in a while: Why is t

Solution 1:

Even though you set Auto update statistics to true, they will update only when a threshold has been reached..this is different for different versions

Thresholds for SQL Server 2012 or older:

  1. The table size has gone from 0 to > 0 rows

  2. The number of rows in the table when the statistics were gathered was 500 or less, and the colmodctr of the leading column of the statistics object has changed by more than 500 since then

  3. The table had more than 500 rows when the statistics were gathered, and the colmodctr of the leading column of the statistics object has changed by more than 500 + 20% of the number of rows in the table when the statistics were gathered

For SQLServer 2016,there are few major changes and SQL Updates statistics with a new algorithm(read as more frequently than old versions)

Do i need to care? How do i know if i need to update them, or if they are causing performance issues for me?

Normally people schedule maintenance jobs during weekends and this includes index rebuild/stats update..

This should normally take care of most databases.In your case,if you are seeing performance issues due to invalid stats,you can update them manually.We do it once a week,but sites like StackOverflow does it more often

update stats tablename

Further reading/references:Statistics Used by the Query Optimizer in Microsoft SQL Server 2008Understanding When Statistics Will Automatically Update

Post a Comment for "Why Are These Sql Server Statistics Outdated, When It's Set To Auto-update?"