SQL Server Monitoring – Statistics Age

Updated August 29, 2021.

Purpose

To show the age of the index statistics when they were last captured.

Sources

This feature queries the DMV dm_db_stats_properties which returns the date of the most recent update for statistics on an index plus information for rows sampled, modification counter, …

If the DMV dm_db_incremental_stats_properties is available (SQL2014+) the incremental statistics will also be collected.

Reports

The report page Statistics Age shows 2 tables.

The upper table has one row for each index and how old the statistics are and the number of rows in the tables (using the data collected by the Table size feature).

The lower table shows the statistics for indexes and partitions that are enabled for incremental statistics.

When hovering over the tables a tooltip is showing the statistic age and the number of rows over time.

Model

The model for the report uses the facts [Statistics age], [Statistics age detailed], [Statistics age incremental] and [Table size] and the dimensions [Object], [Index] and [Date].

The fact [Table size] is included in the diagram as the measures [Last Rows] and [Last Rows (SAD)] queries the column ‘Table size'[Rows].

Configuration

The feature accept the parameter @Databases and the syntax is the same that is used in the SQL Server Index and Statistics Management solution made by Ola Hallengren.

The default parameter for the feature is “@Databases = ‘USER_DATABASES, msdb'”

ValueDescription
SYSTEM_DATABASESAll system databases (master, msdb, model, and tempdb)
USER_DATABASESAll user databases
ALL_DATABASESAll databases
Db1The database Db1
Db1, Db2The databases Db1 and Db2
USER_DATABASES, -Db1All user databases, except Db1
%Db%All databases that have “Db” in the name
%Db%, -Db1All databases that have “Db” in the name, except Db1
ALL_DATABASES, -%Db%All databases that do not have “Db” in the name

Scheduling

The default schedule for the feature is once every day between 06:00 and 07:00

Retention

The default retention for the table dbo.fhsmStatisticsAge is 30 days.