Find out when statistics were last updated.

By SQLRx Admin | Helpful Scripts

Jun 16
Your SQL database uses statistics to choose the most efficient plan for retrieving or updating data, so you want them accurate and up-to-date. Otherwise, it can cause the SQL Server engine to take the wrong path, and taking the wrong path means slower performance. Check out the code below to see when your stats were last updated.
If you need help with SQL server, please contact me. It’s also good practice to regularly monitor the 11 VitalSigns used by SQLRx to debug performance bottlenecks.

SQL 2008     SQL Server Administration Find out when statistics were last updated.   Out of date statistics are a common cause of poor performance.  Tables that are active should have statistics updated regularly.  Use the query below to find out if your databases have old statistics.

USE <<database>>

GO

— find last time when stats had been updated.

SELECT object_id AS [TableId], index_id AS [IndexId], OBJECT_NAME(object_id) AS [TableName], name AS [IndexName], stats_date(object_id,index_id) stat_update_date, INDEXPROPERTY(object_id, name,’IsAutoStatistics’) is_system_generated_stats

FROM sys.indexes WITH (NOLOCK) OPTION(MAXDOP 1)

GO

About the Author

>