DBMS Interview Questions · Question 23

Why can adding too many indexes reduce database performance?

Interview preparation resource from Gate Smashers.

Interview-ready answer

Too many indexes can reduce performance because every write must update additional index structures; indexes also consume disk space and memory and increase maintenance overhead. They speed reads by reducing scans, but each INSERT, UPDATE or DELETE may require creating, removing, or changing index entries. Create indexes only for proven query patterns and important access paths rather than indexing every column automatically.

Understand it clearly

Direct answer

Indexes mainly improve reads by reducing the amount of data the DBMS must scan. However, an index is an extra data structure that must stay synchronized with the table, so adding many indexes increases the work the DBMS must do for writes and for ongoing maintenance.

How indexes affect write performance

Every write operation can require index maintenance because the index entries must reflect the current table state. The more indexes a table has, the more work each write may require.

  • INSERT: New entries may need to be created in every relevant index.
  • UPDATE: Changed indexed values may require index entries to be removed and reinserted (or otherwise updated).
  • DELETE: When a row is deleted, corresponding index entries must be removed from relevant indexes.

Resource and maintenance costs

Indexes consume storage and memory and increase maintenance effort. These costs matter because index pages compete for cache and disk, and more indexes increase the scope of rebuilds, statistics gathering, and fragmentation management.

  • Storage: Each index occupies additional pages/disk space.
  • Memory/cache: Frequently used index pages compete for memory.
  • Maintenance: Rebuilds, statistics and fragmentation work increase as the number of indexes grows.

Recommended approach

The best approach is to create indexes for proven query patterns and important access paths rather than indexing every column automatically. Prioritize indexes that provide measurable read benefits that justify the added write and maintenance cost.