find_unused_indexes
Identify unused, duplicate, and overlapping indexes in PostgreSQL to reduce storage space and improve database performance by removing unnecessary indexes.
Instructions
Find indexes that are not being used or are duplicates.
Note: This tool analyzes only user/client indexes and excludes system catalog indexes (pg_catalog, information_schema, pg_toast). It focuses on your application's custom tables only.
Identifies:
Indexes with zero or very few scans since last stats reset
Duplicate indexes (same columns in same order)
Overlapping indexes (one index is a prefix of another)
Removing unused indexes can:
Reduce storage space
Speed up INSERT/UPDATE/DELETE operations
Reduce vacuum and maintenance overhead
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema_name | No | Schema to analyze (default: public) | public |
| min_size_mb | No | Minimum index size in MB to include | |
| include_duplicates | No | Include analysis of duplicate/overlapping indexes |