# Postgres 19's REPACK lets you shrink bloated tables without taking them offline

Original title: Postgres 19 Repack: Faster, Built-In Table Bloat Cleanup

> Hacker News story 50569516 · language: en · submitted 2026-11-20
> Web version: https://zeli.app/story/50569516
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 180 · by [craigkerstiens](<https://news.ycombinator.com/user?id=craigkerstiens>) · 💬 29
[original](<https://www.snowflake.com/en/blog/engineering/postgres-19-repack-table-bloat/>) · [HN discussion](<https://news.ycombinator.com/item?id=50569516>)

## Summary

Postgres 19 adds REPACK as a built-in SQL command, and its CONCURRENTLY mode reclaims bloated table space while the table stays fully readable and writable, taking only a brief lock at the end. It uses WAL-based logical decoding, the same approach as pg_squeeze, so no triggers or external binaries are needed. In one test, a 493 MB table shrank to 228 MB in 9.4 seconds, roughly 1.5 to 2 times slower than VACUUM FULL but without the downtime.

## Key quote

> REPACK CONCURRENTLY is slower in wall-clock time. It's doing more work: logical decoding and WAL replay on top of the table rebuild. The tradeoff here is more time to keep your table online.

## HN discussion (29 comments)

### [jzelinskie](<https://news.ycombinator.com/item?id=50570379>)

> I haven't used these extensions, but I like the direction of being able to extend Postgres by tailing its own internals (pg_squeeze approach) than triggers (pg_repack).
>
> We (the SpiceDB developers) took a similar approach to solve a different problem a few years ago: implementing strict serializability in Postgres[0]. By hooking into the transactions layer themselves (pg_xact), we could layer on our own MVCC reusing the real Postgres transactions to compute visibility and total ordering. When you can just tail the Postgres internals, you don't even need to implement a Postgres extension, which can keep it portable across locked-down, managed Postgres offerings.
>
> Do folks know of other clever implementations of behavior by "spying" on the Postgres internals?
>
> [0]: https://m.youtube.com/watch?v=_f6fHy4DWWM

### [nopurpose](<https://news.ycombinator.com/item?id=50572160>)

> They added plan hinting, but sadly not via comments. To use hinting an app needs to issue a `SET` command, which adds round trip latency for each query. Need to use quite unergonomic query batching/pipelining to negate that latency.

### [inkysigma](<https://news.ycombinator.com/item?id=50570913>)

> Isn't losing MVCC consistency a pretty big drawback? Am I misinterpreting or does that mean occasionally a query might just return nothing for possibly difficult to diagnose reasons?

---

## Cite

- Page: https://zeli.app/story/50569516
- Date: 2026-11-20
- Source: snowflake.com (https://www.snowflake.com/en/blog/engineering/postgres-19-repack-table-bloat/)
- Hacker News: https://news.ycombinator.com/item?id=50569516

## Other languages

- zh: https://zeli.app/zh/story/50569516 · markdown: https://zeli.app/zh/story/50569516.md
- ja: https://zeli.app/ja/story/50569516 · markdown: https://zeli.app/ja/story/50569516.md
- ko: https://zeli.app/ko/story/50569516 · markdown: https://zeli.app/ko/story/50569516.md
- de: https://zeli.app/de/story/50569516 · markdown: https://zeli.app/de/story/50569516.md
- es: https://zeli.app/es/story/50569516 · markdown: https://zeli.app/es/story/50569516.md
- ru: https://zeli.app/ru/story/50569516 · markdown: https://zeli.app/ru/story/50569516.md
