Skip to content
Knowledge Base
Česky

Database · Indexes · Performance

SQL: Index statistics update date

Robert Haken 1 min read Markdown ↓

Simple query can help you get basic insights on when the index statistics where updated:

[code lang=”sql” light=”true”]
SELECT
o.name AS TableName,
i.name AS IndexName,
STATS_DATE(i.object_id, i.index_id) AS StatisticsUpdate
FROM sys.objects o
INNER JOIN sys.indexes i ON (o.object_id = i.object_id)
WHERE
(i.type > 0)
AND (o.type_desc NOT IN (‘INTERNAL_TABLE’, ‘SYSTEM_TABLE’))
ORDER BY TableName, IndexName
— ORDER BY StatisticsUpdate
[/code]

See also:

Robert Haken · HAVIT Software Architect, Founder at HAVIT, Microsoft MVP - ASP.NET/IIS.
Has 53 articles in the knowledge base.
All articles by this author →
HAVIT
Read next
Discussion

Leave a reply