Missing Index Detection

Find missing indexes.

Overview

Missing index detection finds indexes the database needs but does not have. Sequential scans on large tables are the obvious symptom; subtle ones include index-only scans that fall back to heap fetches because the right covering index is missing. The discipline is in systematic detection (pg_stat_user_indexes, RDS Performance Insights, EXPLAIN ANALYZE on top slow queries) rather than waiting for slow-query incidents to surface the gaps.

The approach

The practical approach is to monitor seq_scan vs idx_scan ratios on every table (the metric is in pg_stat_user_tables), EXPLAIN ANALYZE the top slow queries from Performance Insights or pg_stat_statements, propose candidate indexes against the WHERE/JOIN/ORDER BY columns, validate with add-then-re-EXPLAIN to measure actual impact, and document each new index with its supporting query so the index inventory stays reviewable.

Why this compounds

Missing-index discipline compounds across queries and tables. Each detected and added index produces ongoing query-time savings; each pg_stat_user_indexes review teaches the team where their query patterns evolved past the original index design; the team builds intuition for which queries deserve indexes versus which deserve query-shape changes.

Missing-index discipline is a database discipline that pays off across years. Nova AI Ops integrates with database telemetry, surfaces index patterns, and supports the team’s database engineering discipline.