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 2008 Forums
 SQL Server Administration (2008)
 Clear out report statistics

Author  Topic 

ferrethouse
Constraint Violating Yak Guru

352 Posts

Posted - 2011-06-22 : 16:37:07
When I run an index usage report on the database it tells me the number of index scans, index seeks, etc.

I know that I can restart SQL Server to clear out those statistics but is there a way to clear them out without restarting it?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-06-22 : 16:45:09
Only a couple of DMVs can be cleared, and the DMV that the index usage report uses is not one of them.

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

Subscribe to my blog
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-06-22 : 16:46:38
Looks like you asked this same question 3 months ago: http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=157731


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

Subscribe to my blog
Go to Top of Page

ferrethouse
Constraint Violating Yak Guru

352 Posts

Posted - 2011-06-22 : 17:06:20
Oops, sorry, I ask lots of questions. Don't really understand what was suggested there.

The problem I have is that I have 12 indexes on a table. I added two new indexes a couple of days ago. I want to know if the addition of those two new indexes have caused SQL Server to use other indexes much less - to the point that I can delete them now. There is a "last used" statistic but I can't rely on that because it doesn't give me an idea of how much they are still being used.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-06-22 : 17:37:25
If you can't restart SQL Server, then you'll need to do what YellowBug suggested in your older thread. You'd query the DMV behind this report, which is sys.dm_db_index_usage_stats. Store the results in a table or take some kind of snapshot of it. Then query it again a few hours later/maybe next day and check the delta.

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

Subscribe to my blog
Go to Top of Page
   

- Advertisement -