Automatic statistics refresh
Column statistics are not maintained when the underlying table data changes. The Statistics Manager determines if columns statistics are still valid or if they no longer represent the column accurately (stale).
This validation is done each time one of the following occurs:
- A full open occurs for a query where column statistics were used to create the access plan
- A new plan is added to the plan cache, either because a completely new query was optimized or because an existing plan was re-optimized.
To validate the statistics, the Statistics Manager checks to see if any of the following apply:
- Number of rows in the table has changed by more than 15% of the total table row count
- Number of rows changed in the table is more than 15% of the total table row count
If the statistics is determined to be stale, the Statistics Manager still uses the stale column statistics to answer the questions from the optimizer, but it also marks the column statistics as stale in the Plan Cache and generates a request to refresh the statistics.
Parent topic:
Collecting statistics with the Statistics Manager