# Using JSON: json vs. jsonb, pglz vs. lz4, key optimization, parsing speed?

DevFeed: [Using JSON: json vs. jsonb, pglz vs. lz4, key optimization, parsing speed?](<https://devfeed.tech/articles/using-json-json-vs-jsonb-pglz-vs-lz4-key-optimization-parsing-speed-33670.md>)

Original publisher: [Read original article](<https://www.depesz.com/2025/11/29/using-json-json-vs-jsonb-pglz-vs-lz4-key-optimization-parsing-speed/>)

Author: depesz

Published: 2025-11-29T19:16:00Z

Content type: article

Language: en

Sources: [select \* from depesz;](<https://devfeed.tech/sources/select-from-depesz.md>)

Topics: [JSON](<https://devfeed.tech/topics/json.md>), [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Compression](<https://devfeed.tech/topics/compression.md>), [Optimization](<https://devfeed.tech/topics/optimization.md>), [Parsing](<https://devfeed.tech/topics/parsing.md>)

Tags: [benchmark](<https://devfeed.tech/tags/benchmark.md>), [compression](<https://devfeed.tech/tags/compression.md>), [discord](<https://devfeed.tech/tags/discord.md>), [irc](<https://devfeed.tech/tags/irc.md>), [json](<https://devfeed.tech/tags/json.md>), [jsonb](<https://devfeed.tech/tags/jsonb.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [parsing](<https://devfeed.tech/tags/parsing.md>), [performance](<https://devfeed.tech/tags/performance.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [slack](<https://devfeed.tech/tags/slack.md>), [speed](<https://devfeed.tech/tags/speed.md>), [text](<https://devfeed.tech/tags/text.md>), [uncategorized](<https://devfeed.tech/tags/uncategorized.md>)

## AI overview

This article investigates JSON and JSONB storage in PostgreSQL, comparing pglz and LZ4 compression, storage overhead, key-name handling, and parsing speed. In the reported test, pglz compressed slightly better, while LZ4 processed 16 MB of text faster.

## Source excerpt

Recently(ish) I had a conversation on one of PostgreSQL support chats (IRC, Slack, or Discord) about efficient storage of JSON data, which compression to use, which datatype. Unrelated to this, some people (at least two over the last year or so) said that they aren't sure if PostgreSQL doesn't optimize storage between columns, for example, ... Continue reading "Using JSON: json vs. jsonb, pglz vs. lz4, key optimization, parsing speed?"