When an index helps
- Columns in
WHERE, JOIN ON, ORDER BY, GROUP BY - High-cardinality columns (many unique values) — ideal for email, UUID
When an index hurts
- Tables with frequent INSERT/UPDATE/DELETE — every change updates the index
- Low-cardinality columns (boolean, a status with 3 values) — MySQL may choose a full scan over the index
Composite indexes
An index on (a, b, c) is used left to right: a query with WHERE a = 1 AND b = 2 uses the index, but WHERE b = 2 alone does not. This is the leftmost prefix rule.