When do the missing index DMVs get cleared?

1.1k views Asked by At

I have been using Bart Duncan's classic article to find out what indexes I am missing (http://blogs.msdn.com/b/bartd/archive/2007/07/19/are-you-using-sql-s-missing-index-dmvs.aspx)

Every now when I execute

select * from sys.dm_db_missing_index_details

I get back no rows, where I would have got rows back an hour earlier.

My question is, when do these dmvs get cleared or what sort of time window to they represent?

Thanks for your help

1

There are 1 answers

0
Mitch Wheat On BEST ANSWER

The missing index statistics are flushed from the cache

  1. If there is memory pressure.

  2. If the SQL Server service restarts.

When the metadata for a table changes, all missing index information about that table is deleted from these dynamic management views. Table metadata changes can occur when columns are added or dropped from a table, or when an index is created on a column of a table. Ref.

Also note: if there is little or no activity on the box since the last service restart then there won't be any missing index info gathered.