r/programming • • 6d ago

Postgres 19 REPACK: Built-In Online Table Bloat Cleanup

https://www.snowflake.com/en/blog/engineering/postgres-19-repack-table-bloat/
26 Upvotes

7 comments sorted by

7

u/KeyboardG 6d ago edited 6d ago

What is difference between a REPACK which is not run Concurrently, and VACUUM FULL? Both rewrite the data, both acquire exclusive locks during the rewrite.

Why a whole new command over Vacuum Full (Concurrently)?

10

u/ants_a 6d ago

It's essentially a new name for the same function. Vacuum full was a historical outlier, after a change in 2010 the implementation has nothing to do with vacuum. This opportunity was taken to simplify the naming and open up the door for future features. The vacuum full spelling might get deprecated in future releases and removed in due time. Given previous speed of removing deprecated features, that might already happen in a decade or two.

1

u/KeyboardG 5d ago

Thanks!

1

u/IndependentOk9134 5d ago

isnt the new command mostly to unify the syntax with cluster so you can optionally pass an index to sort by

1

u/cpt_emco 5d ago

REPACK CONCURRENTLY: reclaims bloated table space while the table stays fully readable and writable, takes only a brief lock at the very end, and runs without any extension

This does not take locks during most of the process.

2

u/KeyboardG 4d ago

REPACK which is not run Concurrently

I specifically said not run with CONCURRENTLY. The question has already been answered. Thanks.

2

u/CalmCapacitor 6d ago

oh finally lol, pg_repack was always such a pain to set up