PostgreSQL – Cleanup After Deleting a Large Table on Amazon RDS

amazon-rdspostgresql

I have a database that once held a large table: ~6 billion rows, ~6TB of disk space, ~10 rows inserted/second. The rest of the tables, all told, comes to ~500MB and have infrequent writes. So the big table was completely dominating the database.

I've since deleted that table, moving some of its work to more compact tables, so the DB load isn't gone but the disk space pressure is.

Other than the DROP TABLE bigguy that I ran, is there anything I need to do to make Postgres feel happier? Are there any global indices that need to be cleaned out?

Postgres 9.5 running on Amazon RDS.

Best Answer

No other clean up should be required. If you are really worried, you can watch your database size with:

select pg_database_size('your_database');

To make sure it shrinks by about the amount you expected. It could take until the end of the next checkpoint to fully clean up.

If you were dropping tens of thousands of small tables is where you have you to worry about catalog bloat. One large table is not an issue.