Duplicate Index
pg_views: pg_index, pg_class, pg_attribute
Full detection logic, thresholds, and guided fixes ship in the product.
Book a demo →Overview
Duplicate indexes are pairs where one index's key columns are a prefix of another on the same table. The shorter index is made redundant by the longer one for range scans, but both indexes are maintained on every write. This doubles (or more) write amplification and wastes storage.
The most common cause is two developers independently adding an index for the same column, or an ORM migration adding a redundant single-column index alongside an existing composite index that starts with the same column.
insightral detects exact duplicates and subset duplicates. It reports the pair so a human can decide which to keep—usually the one with a more specific WHERE clause or the one with more recent scans.
See this rule in action
Full detection logic, thresholds, and guided fixes ship in the product. The licensed agent runs this check — and all others — continuously against your database, surfaces findings with AI explanations, and surfaces a guided remediation path inside the dashboard.
Book a demo →Common False Positives
- A unique index and a non-unique index on the same column serve different purposes — the unique index enforces a constraint and cannot be dropped even if a regular index covers it.
- Partial indexes (WITH WHERE) that overlap leading columns but cover different row subsets are not true duplicates.
Duplicate Index — and 100+ more checks — in the licensed product
Full detection logic, thresholds, and guided fixes ship in the product.
Book a demo →Last updated: 2026-05-13 · View the rule library