Shrinking Big PostgreSQL tables: Copy-Swap-Drop

While PostgreSQL supports tables up to 32TB in size, working with large tables of 500GB or more can be problematic and slow.Query performance can be poor, adding indexes or constraints is slow. Backup and restore operations slow down due to these large tables.Large tables might force a need to scale the database server instance vertically to provision more CPU and memory capacity unnecessarily, when only more storage is needed.When the application queries only a portion of the rows, such as recent rows, or rows for active users or customers, there’s an opportunity here to move the unneeded rows out of Postgres.
Shrinking Big PostgreSQL tables: Copy-Swap-Drop #ruby #rubydeveloper #rubyonrails https://rubyonrails.ba/single/shrinking-big-postgresql-tables-copy-swap-drop

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles