---
title: "Postgres 19 Compression: from pglz to LZ4"
url: https://daily.dev/posts/postgres-19-compression-from-pglz-to-lz4-p8yrk9v3c
source_url: https://www.crunchydata.com/blog/postgres-19-compression-from-pglz-to-lz4
type: article
source: "Crunchy Data"
published: 2026-07-16T17:25:57.547Z
updated: 2026-07-16T17:26:19.041Z
tags: ["postgresql", "compression"]
reading_time: 9
upvotes: 3
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Postgres 19 Compression: from pglz to LZ4

**[Crunchy Data](https://daily.dev/sources/crunchydata)** · 9 min read · 3 upvotes · 0 comments

## Summary

Postgres 19 is switching its default TOAST compression algorithm from pglz to LZ4. The post covers the history of Postgres compression starting from version 7.0, explains why pglz was originally built (speed, minimal memory, no external dependencies), and details why LZ4 is a better fit for modern hardware — roughly 8× faster compression and better ratios due to a larger 64 kB sliding window. It also walks through Postgres storage strategies (EXTENDED, PLAIN, EXTERNAL, MAIN), the varlena format for variable-length types, the step-by-step compression decision tree Postgres uses when writing rows, and how compression works in B-tree indexes including the 510-byte threshold and the 2704-byte maximum index row size limit.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.crunchydata.com/blog/postgres-19-compression-from-pglz-to-lz4>

## Similar posts on daily.dev

- [All Your GUCs in a Row: default\_toast\_compression](https://daily.dev/posts/all-your-gucs-in-a-row-default-toast-compression-qjk0nja2b) · Planet PostgreSQL · 0 upvotes · 0 comments

---

Tags: [#postgresql](https://daily.dev/tags/postgresql), [#compression](https://daily.dev/tags/compression)

[View this post on daily.dev](https://daily.dev/posts/postgres-19-compression-from-pglz-to-lz4-p8yrk9v3c)
