Careeroza
When Not to Index
Poor Index Candidates
- Small tables: a full scan is already fast.
- Low-selectivity columns such as a boolean or gender, where each value matches a big share of rows.
- Write-heavy tables (logs, events) where reads are rare.
- Columns that are frequently updated.
- Columns only ever used inside functions in
WHERE(e.g.UPPER(Email)), unless you create a function-based index.
Indexing Checklist
- Find slow queries (slow query log,
pg_stat_statements, Query Store). - Look at their execution plan (
EXPLAIN). - Index the columns used in
WHERE,JOINandORDER BY, most selective first. - Re-check the plan, then measure write performance.
- Remove indexes that are never used.