Postgres

Postgres Bloat Minimization

Supabase

The blog post discusses the usage of vacuuming in Postgres to efficiently maintain tables and prevent data bloat. Each row of data in a table is stored into any page with free space. When a row is updated, it is duplicated, with the old version remaining until the update transaction is completed. Unused rows are cleaned up via an asynchronous process called vacuuming, which frees the space on pages previously taken by these rows, and updates the table's free-space-map. It also updates the visibility map to mark all remaining rows as visible, increasing the speed of index scans. Vacuuming can occur automatically or manually. Sometimes data usage patterns require modification of the autovacuum parameters for efficiency and to prevent bloating. The post also provides coding examples and direct references for further understanding.

read full post