Deployment Task

Frequently updated Postgres tables occasionally can grow quite large in size, causing the database to fill its defined limits.  A common reason for this is excess storage being occupied by dead tuples.  The Postgres team has included a function called VACUUM, documented here.  

VACUUM reclaims storage occupied by dead tuples. In normal PostgreSQL operation, tuples that are deleted or made obsolete by an update are not physically removed from their table. Rather, they remain present until a VACUUM is done. It is, therefore, necessary to do VACUUM periodically, especially on frequently-updated tables.

Deployment Steps

Warning: Before making any changes to your database, it is extremely important that you first perform a thorough backup for recovery, in the event of a failure. 

  • Connect to your Postgres database.  If you are using a database container, follow these instructions to connect. 
  • Once inside the database, you can then run VACUUM images;  (This is assuming that the images table is consuming an irregular amount of space)

This can sometimes free up a significant amount of space in the table.