Finding unused indexes, table bloat and missing primary keys with Postgres catalog queries
Every Postgres database we inherit has the same hidden costs: indexes nobody reads, tables twice their real size, and tables without a primary key. These are the catalog queries we run on day one, how to read them safely, and how to clean up without downtime.