Today I learnt about the Postgres VACUUM FULL 👨‍💻

We currently have an issue with our EC2 server running Redash where it’s eating the world by taking up more and more disk space.

Carlos spotted that the Postgres data directory is taking up majority of the space but strangely our DB didn’t contain that much data 🤔.

It seems that Postgres is not always freeing up space even after it deletes data but running the VACUUM FULL command can free this space up.

The Postgres docs state VACUUM FULL takes a long time and exclusively locks the table, it also requires extra disk space, since it writes a new copy of the table and doesn’t release the old copy until the operation is complete. So if you’re trying to free up space you’ll need to increase your HD size first.

Scary vaccum cleaner