PG-R04hygieneReversibility: manual

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

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