This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In this post, I am sharing one script to find Outdated Index Statistics of SQL Server.
Database Statistics are playing the main role to prepare a best query execution plan because Query Optimizer reads the Object Statistics and takes the decision accordingly.
SQL Server Statistics stores information like: object meta-data, location information, number of records.
If your Object Statistics are not updated, It impacts your query performance so You should find outdated statistics and periodically, you should update the statistics data.
Script to find Outdated Index Statistics Information:
1 2 3 4 5 6 7 8 9 10 |
SELECT OBJECT_NAME(id) ,name ,STATS_DATE(id, indid) ,rowmodctr FROM sys.sysindexes WHERE STATS_DATE(id, indid)<=DATEADD(DAY,-1,GETDATE()) AND rowmodctr>0 AND id IN (SELECT object_id FROM sys.tables) GO |
Leave a Reply