Columns with many distinct values tend to benefit more.
Section: Core concepts
Prefer high-selectivity columns
sql
sql
-- Better index candidate
WHERE email = ?
-- Often weaker candidate by itself
WHERE is_active = trueExplanation
An index on a highly selective column usually narrows results faster than an index on a low-cardinality flag.
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.
Remember the write cost
Every extra index must be maintained during inserts, updates, and deletes.
Composite index left-prefix rule
Use column order that matches real filter patterns.