What was last time, when 'update statistics' ran on a table ?
Whenever a query or SP does not perform as before, among all other investigation steps, checking update statistics on the underlying tables, is one of the very first steps.
You can use the following SQL to get the 'last run date', of update statistics on a table.
--#sysstatistics table contains the table statistics data.
select moddate from sysstatistics where id = object_id("your_table_name")
Note that, this may produce a list of dates. This is because, sysstatistics table maintains one or more entries for each of the index columns of the table. It may contain entries for non-indexed columns as well.
Make sure, you run update statistics on tables regularly, specially the tables whose volume changes considerably, over the time.
Related Posts:
what is 'update statistics'
Wednesday, May 28
How to get last 'update statistics' run date
Labels:
SQL Performance,
SQL Tips
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment