Around a year ago we made some big changes to the ETL process in our Oncology data warehouse. The change allowed us to greatly reduce bloat in the data warehouse indexes and tables. The only problem, this system uses lots and lots and lots of temp tables. The result of this, we are now bloating the PostgreSQL catalog table pg_catalog.pg_class a substantial amount. Fortunately the community was a great help and some e-mails on the PostgesSQL e-mail list pointed to a solution.
The simple solution I decided to take, just put this into a nightly cron job:
VACUUM FULL pg_catalog.pg_class;REINDEX TABLE pg_catalog.pg_class;Now pg_attribute could not be cleaner, I love simple solutions.


