Every extra index must be maintained during inserts, updates, and deletes.
Section: Core concepts
Remember the write cost
text
text
More indexes => faster reads, slower writes, more storage, longer maintenance operations.Explanation
Do not index everything. Add indexes to support real queries, not hypothetical ones.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Core concepts
What an index does
Indexes trade storage and write cost for faster reads.
Prefer high-selectivity columns
Columns with many distinct values tend to benefit more.
Composite index left-prefix rule
Use column order that matches real filter patterns.