Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Clearing Old Data from sys.dm_db_missing_index_det

Author  Topic 

jbates99
Constraint Violating Yak Guru

396 Posts

Posted - 2011-01-11 : 20:52:53
Hi everyone,

I'm using (2005's) sys.dm_db_missing_index_details DMV to identify columns that should have indexes.

It returns a lot of extraneous data that is unrelated to my query.

How can I flush the view or table just before running my query - so I will only see rows that apply to my query?

Hope my question makes sense.


Thanks, John

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-01-11 : 23:31:04
You will need to restart the SQL Server service.

The DMV is for all queries and not just the one you are working on.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2011-01-12 : 00:43:41
The best option for you will be use the DTA for to find the missing index details for that particular query.

PBUH

Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-01-12 : 01:43:50
Or run the query with execution plan and look into the xml of the query for the missing index information for that query. It's only exposed in SSMS in 2008, but it's still in the plan for SQL 2005.

p.s. clearing the DMV can be done by offline/online of the DB, restart of the instance not required.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -