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

  1. Find slow queries (slow query log, pg_stat_statements, Query Store).
  2. Look at their execution plan (EXPLAIN).
  3. Index the columns used in WHERE, JOIN and ORDER BY, most selective first.
  4. Re-check the plan, then measure write performance.
  5. Remove indexes that are never used.