Changelog
Change is the only constant. All the works here gets corrected, updated and/or extended after publication. PostgreSQL releases are major factor, readers catch things I got wrong or misleading. This page is a honest record of that. Every publication and every revision, newest first.
2026
- new B-tree pages, sorted and sparse Why a PostgreSQL B-tree index stays the same size after VACUUM, shown page by page with pageinspect: leaves, high keys, and which new keys can reuse the free space.
- updated PostgreSQL Storage Internals New chapter 10, B-tree pages, sorted and sparse: one leaf before and after a mass DELETE, the high keys the root is built from, and why new keys cannot use the space VACUUM leaves in an index. It comes with a B-tree visualizer.
- updated PostgreSQL Shared Buffers Visualized The visualizer now opens on two scripted scenarios over a pool of 16 labelled buffers: one page going through a miss, a hit, a write and a checkpoint, and the clock hand moving one buffer at a time until it finds a victim. Evicting a dirty buffer now writes it out first; the sweep used to drop it silently. The 128-buffer live simulation is kept as free play.
- updated Inside the 8KB Page: PostgreSQL Page Layout Visualized Two guided scenarios, How a page fills and What a DELETE leaves behind, step through the page one statement at a time with a caption for each step. The original controls are under Free play, each stat shows its previous value after a statement, and the region detail stays folded until a region of the map is clicked.
-
updated
PostgreSQL MVCC Visualized
The visualizer now opens on three scripted scenarios (read committed, repeatable read, and a dead row version that VACUUM has to leave alone) that drive both sessions one statement at a time, with the original two-session controls kept as free play. A
REPEATABLE READtransaction now takes its snapshot at its first statement, as PostgreSQL does; the visualizer used to take it atBEGIN. -
updated
PostgreSQL HOT Updates and Page Pruning Visualized
The visualizer now opens on two guided scenarios, each one statement per step with a short caption: a HOT chain built over three updates and then pruned, and an update of an indexed column that has to write to every index. The original buttons are still there under free play. The legend is one line and the line pointer inspector stays folded until you click a line pointer. Two corrections to what VACUUM does, both checked on PostgreSQL 18: it removes the index entries left behind by an indexed-column update (the visualizer kept them until
REINDEX), and it leaves anLP_REDIRECTin place with the index entries still pointing at it (the visualizer had VACUUM rewrite the entries and free the slot). -
updated
PostgreSQL VACUUM at the Page Level Visualized
Page pruning leaves the free space map untouched: on PostgreSQL 18 it reclaims the bytes on the page, but
pg_freespacekeeps reporting the old value until VACUUM's heap cleanup pass records the new one. The visualizer used to update the FSM at the prune. Each heap page now shows both numbers while they differ, and anINSERTafter a prune alone fills the last page and then extends the table. The page also opens on two guided scenarios now, one statement per step with a short caption, and the original buttons moved under free play. The all visible mark on a page is now a stored bit that only VACUUM sets and any INSERT or DELETE clears, so a page added by an INSERT no longer shows as all visible before a VACUUM has seen it. -
updated
PostgreSQL TOAST Visualized
Three guided scenarios step through TOAST one statement at a time: values of growing size, one value under each of the four storage strategies, and an
UPDATEwhose old chunks stay dead untilVACUUM. The original controls are under Free play. Sizes are in decimal kB to match the button labels, chunks are drawn as numbered squares, and anUPDATEthat fails underPLAINno longer marks the old chunks dead.
-
updated
The curious case of Google's AlloyDB
I got the explanation of the SF100 write drop wrong. The 29% and 16% are what the run measured, but the two scan loops didn't run the same number of scans, and I never measured memory bandwidth. Also updated the Omni Docker tag to
17.10.0.
-
updated
Getting rid of a 4 TB table in PostgreSQL
Added ZFS measurements: a cold 100 GB table dropped in about 90 ms on ZFS against 0.6 to 1.2 s on ext4, with the space freed 11 to 14 s later, and a ZFS standby replayed a 100 GB drop with 103 ms of peak lag. Also added extent counts for a standby built with
pg_basebackup.
- new Getting rid of a 4 TB table in PostgreSQL Dropping a large table writes 80 KB of WAL, then stalls replay on every replica while the files are unlinked: 16 s for a cold 1 TB table on ext4, 80 ms on XFS. Plus what batched deletes and copy-and-swap cost when the table still has traffic.
- updated DELETEs are difficult Added measured costs of the alternatives to batching: dropping a table writes about 80 KB of WAL whatever its size, while deleting 90% of a 192 GB table in batches wrote 229 GB of WAL and gave no disk back. Numbers and method in Getting rid of a 4 TB table in PostgreSQL.
-
updated
PostgreSQL MVCC, Byte by Byte
A DELETE only stamps
t_xmaxon the existing version. Earlier text said both UPDATE and DELETE append a new one; only UPDATE does. -
updated
DELETEs are difficult
Fixed how DELETE, autovacuum and replication actually work. New section on unindexed foreign keys, and keyset batching instead of
ctid.
- new How TABLESAMPLE picks rows TABLESAMPLE picks addresses, not rows: SYSTEM samples come in bundles, BERNOULLI with REPEATABLE drifts after an UPDATE, and a hashed key gives you the same rows tomorrow.
- new Postgres relation files, filed under base/ The files behind a PostgreSQL table: relfilenode versus OID, the fsm, vm, and init forks, 1GB segments, and what od on the file shows that pageinspect on the buffer doesn't.
- updated PostgreSQL Storage Internals New chapter 3, Postgres relation files, filed under base/: where a page lives on disk, the forks that share its relfilenode, and why the file and the buffer disagree until a checkpoint.
-
updated
Instant database clones with PostgreSQL 18
Corrected the description of the default
template1database, theWAL_LOGstrategy, and which files a single UPDATE touches.
- new What REPACK (CONCURRENTLY) costs while it runs PostgreSQL 19 comes with online table rewrites. Measured against pg_repack and pg_squeeze REPACK (CONCURRENTLY) is the fastest and the lightest on WAL under writes. Here's what it does to vacuum, readers, writers and old snapshots while it runs, and what to check before you start it.
-
updated
The Bloat Busters: pg_repack vs pg_squeeze
Links to What REPACK (CONCURRENTLY) costs while it runs, which measures core
REPACK (CONCURRENTLY)against both extensions on PostgreSQL 19.
-
updated
The Bloat Busters: pg_repack vs pg_squeeze
PostgreSQL 19 adds
REPACK (CONCURRENTLY)to core. Updated the comparison with measured WAL volume, swap stalls, repeatable-read visibility, and concurrent memory limits for both extensions, plus pg_squeeze's 18.6+output_plugin_librariesrequirement.
- new Where PostgreSQL stores row locks What SELECT FOR UPDATE, FOR SHARE, and a foreign key check actually write into the tuple header. t_xmax as a locker, the infomask bits that say so, MultiXactIds when two sessions lock the same row, and the pg_multixact files that grow behind them.
-
updated
Read your own writes, off the primary
Inside a transaction block,
WAIT FORhas to come first. Sincef7c0929170ait fails if the session already holds a lock, even withNO_THROW. REPEATABLE READ works too, as long as the wait runs before the first query. thanks to Sami Imseih
-
updated
Introduction to Buffers in PostgreSQL
Reworked the article around a live
pg_buffercachesession: what the buffer pool actually holds after a query, why aSELECTcan dirty a page, and how eviction plays out. Also corrected the version that introducedvacuum_buffer_usage_limit.
- new The unbearable lightness of one more index Thirty PostgreSQL schemas written by coding agents, loaded and measured. The indexes are competent; the cumulative cost is not.
-
updated
Read your own writes, off the primary
One naming cleanup landed after this was written. The command tag the statement returns is
WAIT, while the beta documentation called itWAIT FOReverywhere, and the tag cannot change once 19.0 ships. The -hackers agreement is to keep the tag and rename the documentation, error messages, and reference page toWAITinstead. The syntax does not change, you still writeWAIT FOR LSN '...', but if you match on error text or link to the docs page, the wording and the anchor will differ from the betas.
- new Read your own writes, off the primary WAIT FOR in PostgreSQL 19 lets a reader block until the replica has replayed a specific LSN. Measured against sticky routing, sleeps, and synchronous commit, on a replica that misses the write 99% of the time.