Statistics Maintenance
Statistics maintenance keeps SQL Server's query optimizer informed about the actual distribution of data in your tables. When statistics fall out of date, the optimizer may generate inefficient execution plans — leading to slow queries that are difficult to diagnose. DB24 automates statistics updates by identifying objects that have drifted beyond configured thresholds and updating them on a schedule.
Eligibility
A statistics object must meet all of the following conditions to be included in a maintenance run.
| Condition | Rule | Notes |
|---|---|---|
| Age | More than 20 hours since last update | Prevents unnecessary churn on recently updated statistics |
| Modified rows | At least 200 rows changed since last update | Skips near-static tables where an update would have no practical effect |
| Row count | At least 1,000 rows total | Statistics on very small tables have negligible impact on query plans |
| User table | Must be a user table | Excludes internal system objects |
| No recompute | NORECOMPUTE must not be set |
Statistics explicitly opted out of automatic updates are never touched |
| Temporary | Must not be a temporary statistics object | Excludes stats tied to temp tables or internal query objects |
| AG role | Database must not be an AG secondary | Statistics updates require a writable primary replica |
| Filegroup | Table's filegroup must not be read-only | Only read/write filegroups are targeted |
Things Worth Knowing
The age threshold is in hours, not days.
The 20-hour default means roughly one day, but the check is based on hours — so a statistics object updated 19 hours ago is skipped, while one updated 21 hours ago qualifies. Keep this in mind when tuning thresholds or interpreting maintenance logs.
NORECOMPUTE statistics are intentionally excluded.
If a statistics object has been flagged with NORECOMPUTE, it was explicitly configured to opt out of automatic maintenance — typically by a DBA or an application with specific tuning requirements. DB24 respects this flag and will never update these objects. If you believe a NORECOMPUTE statistic should be maintained, the flag must be removed manually first.
Auto-created statistics are included.
Statistics created automatically by SQL Server (recognisable by the _WA_Sys_ naming prefix) are eligible for maintenance just like manually created statistics. The only exclusions are NORECOMPUTE and temporary statistics — not whether the stat was user-created.
msdb system tables are included by default.
Tables such as backupset, backupmediafamily, and sysmail_log are technically user tables from SQL Server's perspective, even though they are owned by the system. They pass the eligibility check and will be included in maintenance runs unless msdb is explicitly excluded via the exclusions table. If msdb is outside your intended maintenance scope, add it as an exclusion.
Modification Percentage
In addition to the raw eligibility filters above, DB24 tracks the modification percentage for each statistics object — the number of row changes since the last update expressed as a proportion of the total row count. While this does not affect whether an object qualifies for maintenance, it is available in maintenance output and can be used for prioritisation and trend analysis.
