Clearing Missing index usage

  • Dear All,

    Is there a way to clear the missing index usage views.

    We worked during last period on index tuning, adding new indexes ,removing duplicate and unused ones.

    I need to clear sys.dm_db_missing_index_group_stats ,

    sys.dm_db_missing_index_groups and sys.dm_db_missing_index_details

    without having to restart SQL server process and without affecting caching on server becuase it will be done on live enviroment.

    Thanks in advance and looking forward for ur replies.

    Nader Galal

  • From the Books Online:

    The missing indexes feature is on by default. No controls are provided to turn the feature on or off, or to reset any of the tables returned when the dynamic management objects are queried. When SQL Server is restarted, all of the missing index information is dropped.

    This feature can only be disabled if an instance of SQL Server is started by using the -x argument with the sqlservr command-prompt utility. For more information, see sqlservr Application.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • I believe it is cleaned when the database closes, hence take the DB offline and bring it online and it should be cleared.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • To clear the data in those views, you need to offline and online the database at a minimum. Restarting SQL Server is an alternative. There is no other way to clear that information without doing one of those two things (restart or offline/online the database).

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • I agree with the others EXCEPT...

    If you have created indexes that closely match those recommended in the DMVs SQL will clear the matching indexe information from the vews.

    Leo

    Striving to provide a better service.

    Leo
    Nothing in life is ever so complicated that with a little work it can't be made more complicated.

  • Thanks for all replies.

    Unfortunately this is a live enviroment so its not possible to take db offline and bring it back.

  • nadersam (5/20/2010)


    Thanks for all replies.

    You're welcome.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • I've managed to clear out that information by creating the indexes suggested. And by deleting those again and other indexes, new and different suggestions came up.

  • Just remember that those are suggestions. Don't blindly implement them. Always test them and validate them.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply