Menu

PostgreSQL 17 VACUUM Overhaul: Adaptive Radix Trees End the 1GB Limit
πŸ–ΌοΈ

PostgreSQL 17 VACUUM Overhaul: Adaptive Radix Trees End the 1GB Limit

DEV Community: postgresΒ·Syed AnzarΒ·about 22 hours ago
#RG3RXoRx
#devtopostgresql#devto#dev#vacuum#postgresql
Reading 0:00
15s threshold

PostgreSQL 17 VACUUM Overhaul

Most developers know VACUUM reclaims dead tuples. Few know how it tracks them β€” until PostgreSQL 17, a hardcoded 1GB ceiling silently crippled autovacuum on busy tables.

PostgreSQL 17 replaces the flat array with an adaptive radix tree (ART) based TIDStore, cutting memory use up to 20x and collapsing multiple index vacuum phases into one.

The Old Way: Flat Array, 1GB Cap

Pre-17 used a simple ItemPointerData array. Each dead tuple costs ~6 bytes. Even with maintenance_work_mem = 4GB, vacuum silently stopped at 1GB, then vacuumed indexes, released the array, and resumed β€” repeating for every 1GB chunk.

This staccato behavior appears in pg_stat_progress_vacuum as index_vacuum_count incrementing repeatedly.

The New Way: TIDStore + ART

PostgreSQL 17 introduces TIDStore built on adaptive radix trees (Leis et al., 2013).…

Continue reading β€” create a free account

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