Find unused indexes postgres

Indexes never scanned (idx_scan=0); candidates to drop and reclaim space

SELECT relname, indexrelname, idx_scan, pg_size_pretty(pg_relation_size(indexrelid)) AS size FROM pg_stat_user_indexes WHERE idx_scan=0 ORDER BY pg_relation_size(indexrelid) DESC;
more postgres all 29 commands →