How many database indexes is too many?

后端 未结 17 2123
终归单人心
终归单人心 2020-12-07 08:09

I\'m working on a project with a rather large Oracle database (although my question applies equally well to other databases). We have a web interface which allows users to

17条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-07 09:07

    Everyone else has been giving you great advice. I have an added suggestion for you as you move forward. At some point you have to make a decision as to your best indexing strategy. In the end though, the best PLANNED indexing strategy can still end up creating indexes that don't end up getting used. One strategy that lets you find indexes that aren't used is to monitor index usage. You do this as follows:-

    alter index my_index_name monitoring usage;
    

    You can then monitor whether the index is used or not from that point forward by querying v$object_usage. Information on this can be found in the Oracle® Database Administrator's Guide.

    Just remember that if you have a warehousing strategy of dropping indexes before updating a table, then recreating them, you will have to set the index up for monitoring again, and you'll lose any monitoring history for that index.

提交回复
热议问题