psql -d appdb -c "VACUUM;"

Category: Databases & SQL

psql -d appdb -c "VACUUM;"

Reclaim dead rows in all tables

Removes dead rows and updates the visibility map so space becomes reusable; the manual counterpart of autovacuum, the background process that reclaims bloat automatically. Cheap and safe to run during quiet hours; it does not lock tables.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.