PostgreSQL 19's REPACK CONCURRENTLY cuts table lock from five seconds to under one
PostgreSQL 19 introduces a REPACK command whose CONCURRENTLY option replaces VACUUM FULL and the pg_repack extension. In tests on a 2-million-row table, client blocking dropped from 4.3–5.3 seconds to 0.35–0.93 seconds, while WAL writes rose by 4–25%.
- REPACK CONCURRENTLY holds an exclusive lock only for the final file swap
- With 10 clients, total blocked time fell from 54.4s to 2.73s
- WAL written rose from 655–783 MB to 816 MB for the same rewrite
- Parallel REPACK jobs are capped by max_repack_replication_slots, default 5
Read next
Software