Statistics/indexes question

  • Hello All,

    This may be a simple question, how do I find out when the statistics on the database was updated and when was the last time the indexes were rebuilt/reorganized

    Thanks

    Shri

  • The function STATS_DATE gives the last updated statistics on an index...

    SELECT name AS index_name,

    STATS_DATE(object_id, index_id) AS statistics_update_date

    FROM sys.indexes

    --Ramesh


  • Ramesh,

    Thanks for the script, how do I know when was the last time the indexes were rebuilt/reorganized. I am trying to come up with a daily/weekly maintenance plan and would like to get the date when the index was rebuilt.

    Thanks

    Shri

  • shri_sastry (2/6/2009)


    Ramesh,

    Thanks for the script, how do I know when was the last time the indexes were rebuilt/reorganized. I am trying to come up with a daily/weekly maintenance plan and would like to get the date when the index was rebuilt.

    Thanks

    Shri

    You don't want to rebuild indexes just because they are getting old not to mention you don't want to keep mass rebuilding indexes at all; you want to entertain the possibility of rebuilding a specific index when needed.

    There are already several discussions on this forum about this issue, many of them include pretty sound advice.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

Viewing 4 posts - 1 through 4 (of 4 total)

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