← Backend PythonQuestion 41 of 49
Why can having too many indexes slow down a database even though indexes improve query performance?
📘 Explanation
Every index must be updated on each write, so more indexes mean more overhead for INSERT, UPDATE, and DELETE, and sometimes indexes aren't even helpful due to small table size or stale statistics. The other options describe incorrect mechanisms like row-level locking tied to indexes, indexes living only in RAM, or the planner being slowed down by merely having many indexes to consider.
Related questions
- Why might a query using LOWER(email) not use an index on email?
- Why might PostgreSQL choose a sequential scan instead of using an index?
- What is the difference between ANALYZE and VACUUM ANALYZE in PostgreSQL?
- What is the left-prefix rule for composite indexes?
- If PostgreSQL chooses a bad query plan because statistics are stale, what command should you run?
← PreviousNo login needed