PostgreSQL

Unused PostgreSQL indices consuming write IO and disk space

warning
performanceUpdated Mar 24, 2026
How to detect:

Database indices with idx_scan = 0 that are never scanned waste write IO on every INSERT/UPDATE operation and consume disk space unnecessarily

Recommended action:

Query pg_stat_user_indexes to find indices with idx_scan = 0, then remove via db_index=False in Django models and run makemigration. Use RemoveIndexConcurrently in migrations to avoid blocking operations. Check write IO with pg_stat_statements ordered by blk_write_time DESC.