Menu

1 / 3

PostgreSQL 19 REPACK: A Complete Guide to Reclaiming Table Bloat

DEV Community: postgres·Kamal G·15 days ago
#FWHLJaRW
#devtopostgresql#devto#dev#repack#table
Long article (2260 words) — no AI summary yet.
Reading 0:00
15s threshold

Darshan Turakhia reported that a high-traffic notifications table accumulated 11.2 million dead rows . In that case, the autovacuum threshold and I/O budget let new dead tuples accumulate faster than vacuum could clear them. The table plus indexes occupied 41 GB before pg_repack reduced them to 9.8 GB. More generally, ordinary VACUUM makes dead-tuple space reusable inside PostgreSQL but usually does not shrink the relation file.

PostgreSQL 19 introduces REPACK as a core SQL command to solve this exact gap.

TL;DR

PostgreSQL 19 introduces REPACK , a built-in SQL command that reclaims disk space caused by table bloat by rewriting tables and rebuilding indexes. It replaces VACUUM FULL and CLUSTER as the primary table-rewrite command.

VACUUM vs. REPACK: Regular VACUUM cleans up dead tuples and makes space reusable but generally doesn't reduce table file size.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.