Drop or keep less frequently used indexes

Surendra Adhikari 211 Reputation points
2020-11-27T06:51:26.24+00:00

In a database, there many indexes created for most of the tables. some indexes are highly frequently used while some are used once in a month. Due to many indexes the insert is very slow. But the indexes are used once every month by monthly report queries. So do I drop or keep the indexes? What is the solution to this situation?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,788 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,637 questions
0 comments No comments
{count} votes

Accepted answer
  1. tibor_karaszi@hotmail.com 4,311 Reputation points
    2020-11-27T07:45:19.777+00:00

    There's no "solution" to this. Only your prioritization. Do you prioritize the reports or the inserts? You can of course disable the indexes and rebuild then before the reports, but chances are that the rebuild takes longer time than running the reports without the indexes.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Olaf Helper 44,501 Reputation points
    2020-11-27T07:20:18.207+00:00

    If the report is only once per month then it shouldn't be a big issue if it runs slow.

    Deactivate the index and run the report to see the result; if it's inadmissible slow then you can activate (rebuild) the index again.

    0 comments No comments

  2. CathyJi-MSFT 22,201 Reputation points Microsoft Vendor
    2020-11-27T09:46:56.54+00:00

    Hi @Surendra Adhikari ,

    We can use DMV monitor the usage of these indexes, to identify the indexes that are badly used, or not used or less used, and drop it or replace it with more optimal ones if required. Please check if below blog could help you.

    Gathering SQL Server indexes statistics and usage information

    Best regards,
    Cathy


    If the response is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.