Forum Discussion
DominikS
Oct 31, 2025Copper Contributor
Query on sys.dm_db_index_usage_stats slow
Hi,
we discovered that queries on sys.dm_db_index_usage_stats are getting very slowly when the sql server is running for a longer time without restart.
The execution time is up to 30 seconds for the following query:
SELECT object_name(object_id) objectName, last_user_update
FROM sys.dm_db_index_usage_stats
WHERE database_id=db_id()We get the following query plan:
The Actual Rows in LOGINDEXSTATS are about 2 million.
We found 2 similiar cases by searching the internet:
- https://stackoverflow.com/questions/52165370/query-against-sys-tables-sys-dm-db-index-usage-stats-slow
- https://www.linkedin.com/pulse/sql-server-2014-object-dependencies-dmvdmf-slow-andrea-bruschetta
We tested the workaround (UPDATE STATISTICS sys.*** WITH FULLSCAN;) without success.
How can we increase performance without restarting the database?
Regards
Dominik
No RepliesBe the first to reply