← Tuesday, October 13, 2026DatabasesDeep dive

Postgres TOAST compression can trigger when a value grows by one byte

planetscale.com by Ahmed Darwich 12 min read Editor score 8/10

Preview image for Postgres TOAST compression can trigger when a value grows by one byte

The piece shows that a 2,000-byte value remains uncompressed while a 2,001-byte value is compressed to 26 bytes, then explains row-page limits and TOAST behavior. It also covers Postgres 19's shift to LZ4, useful context for storage and compression trade-offs.

What
TOAST compresses variable-length values when a Postgres row gets too large, and can move them out of the row if compression is insufficient.
How
A 2,000-character repeated value stays uncompressed, while 2,001 characters triggers LZ4 compression to 26 bytes.
Why it matters
Knowing the row-size trigger and compression behavior helps engineers reason about storage costs; Postgres 19 defaults to LZ4 when supported.

Discussion

Discussion is not switched on yet. Use Note above to keep your own thoughts on this story.

Headline, summary, brief and diagram are written by a model from the source's own text; the link, byline and numbers come from the source. Read the original before relying on a claim.

Your note

Private to you. Stored in this browser, and synced to your account when you are signed in.