190MB to 60MB: PostgreSQL 19's REPACK ties VACUUM FULL
PostgreSQL 19's new REPACK command shrank my bloated table from 199.8 MB to 59.9 MB in 471 ms — the same size, to the byte, in the same time as VACUUM FULL. The version that doesn't block writers took 590 ms and left 262,144 extra bytes behind. The feature is real. The speedup is not.
PostgreSQL 19 shipped yesterday (November 19, 2026) with REPACK as a first-class SQL command. Per the release notes, it replaces VACUUM FULL and CLUSTER — the old commands are retained for compatibility — and REPACK (CONCURRENTLY) rebuilds a table without blocking reads and writes, using logical decoding to replay concurrent changes. There is also a new pg_stat_progress_repack view. I built 19.0 from source and measured all three paths on the same bloated table, plus whether the "doesn't block" part actually holds.
The setup
I compiled PostgreSQL 19.0 from the release tarball (gcc 13.3.0, 4-vCPU VM, fsync=off, synchronous_commit=off — a benchmark rig, not a production config). The test table:
CREATE TABLE bloat(id int PRIMARY KEY, payload text); INSERT INTO bloat SELECT g, repeat('x',150) || g::text FROM generate_series(1,1000000) g; DELETE FROM bloat WHERE id % 10 < 7; VACUUM bloat; One million rows in, 700,000 deleted, plain VACUUM run so the dead tuples are marked reusable but the file doesn't shrink. Result: 300,000 live rows in a 199,811,072-byte table (222,380,032 bytes including the primary-key index). Seventy percent dead weight, which is roughly the shape of a real churned table.
The scoreboard
Each method ran on a freshly rebuilt copy of the same bloated table:
Method Wall Table after Total after vs bloated VACUUM FULL 468 ms 59,949,056 B 66,715,648 B -70.0% REPACK 471 ms 59,949,056 B 66,715,648 B -70.0% REPACK (CONCURRENTLY) 590 ms 60,211,200 B 67,018,752 B -69.9% Two things stand out. First, REPACK and VACUUM FULL produced byte-identical results — 59,949,056 bytes for the table, 66,715,648 total, and the same 300,000 live rows. Same rewrite, same size, same 470 ms. It is a rename with a new option, not a faster engine.
Second, REPACK (CONCURRENTLY) cost 26% more wall time and left the table 262,144 bytes larger — exactly 32 pages of 8 KB. That is the overhead of the online path: logical decoding setup plus replaying concurrent changes, and a new heap that doesn't pack quite as tight. On a 60 MB table it is noise; on a 600 GB table it would be about 2.6 GB of leftover slack, worth knowing before you schedule it.
These numbers line up with the Snowflake engineering blog's own test on a constrained box (1 CPU, 512 MB RAM): their 493 MB table went to 228 MB under all three methods, with VACUUM FULL at 2.7 s, REPACK at 5.9 s, and REPACK (CONCURRENTLY) at 9.4 s. Their plain REPACK was 2.2x slower than VACUUM FULL; mine tied it. Either way, nobody's REPACK beats VACUUM FULL on speed. The blog's own conclusion matches mine: concurrently is slower in wall-clock time because it does more work, and the tradeoff is keeping the table online.
Does CONCURRENTLY actually not block?
That is the claim that matters, so I tested it with a writer loop: single-row updates in autocommit transactions, lock_timeout = '500ms', counting successes and lock timeouts while each method ran. The writer started before the operation, so it was already running when the rebuild began.
First I validated the detector: holding an explicit ACCESS EXCLUSIVE lock for 4 seconds produced 6 lock timeouts out of 169 writer attempts. The detector works — a blocking operation shows up as errors.
Then the real runs, on a 3-million-row version of the table (~600 MB bloated, 900,000 live):
Method Wall Writer ok Writer lock errors VACUUM FULL 1,345 ms 1,692 2 REPACK (CONCURRENTLY) 3,333 ms 1,383 0 VACUUM FULL blocked two updates — each one waited 500 ms on the exclusive lock and gave up. REPACK (CONCURRENTLY) blocked zero across its full 3.3 seconds, while 1,383 updates landed on the table it was rewriting. The non-blocking claim holds. (The concurrent run's 3.3 s wall time includes serving that writer load, so don't compare it directly against the 1.3 s vacuum; the clean no-writer comparison is the 590 ms vs 468 ms above.)
One honest correction about my own method: my first attempt at this test got the answer backwards. I ran the writer as a single 12-second transaction, which meant the writer held a row lock for the whole window — and VACUUM FULL queued behind it. All three methods then reported identical 12-second walls and zero writer errors, which looked like nothing blocks anything. The flaw was mine: a long-lived writer transaction inverts the measurement. The numbers above come from the fixed version, one autocommit update per attempt.
Watching it work
pg_stat_progress_repack does what it says. Sampling it during a concurrent repack showed the phases ticking over:
initializing:0/0 seq scanning heap:8875/24391 seq scanning heap:21977/24391 heap_blks_scanned / heap_blks_total gives a real percent-complete during the scan — 36% and 90% in those two samples. The view also covers CLUSTER and VACUUM FULL, so it is worth adding to your monitoring regardless of which command you run.
The fine print
The Snowflake post flags one caveat I did not test: REPACK (CONCURRENTLY) is not fully MVCC-safe. During the brief final swap, a transaction holding a snapshot from before the repack started can see the table as empty. Same limitation pg_repack had, documented in the release notes. If your workload holds long snapshots, read that section before you run it in production. The other requirements: 2x disk space during the rebuild, a logged table with an indexable primary key, no partitioned tables, one concurrent REPACK per database.
The bottom line is unglamorous and useful: REPACK is VACUUM FULL with a better name and an online mode. If you have a maintenance window, either command does the same job in the same time. If you don't, CONCURRENTLY costs you roughly a quarter more time and half a percent more space — and zero blocked writes. That is the whole deal, and it is a good one.
Limitations, stated plainly
- One table shape (integer PK, ~200-byte text rows), one small VM (4 vCPU,
fsync=off), synthetic data. Ratios, not absolutes, are the takeaway. - I did not test
REPACK ... USING INDEX, partitioned tables, or the MVCC snapshot caveat. - Wall times are single runs; the 468 vs 471 ms tie is within run-to-run noise, which is itself the point — there is no speed gap to find.
Sources: PostgreSQL 19.0 release notes (released November 19, 2026); Snowflake, "Postgres 19 Repack: Built-In Online Table Bloat Cleanup". All benchmarks run locally November 20, 2026: PostgreSQL 19.0 built from source, gcc 13.3.0, 4-vCPU VM.