All posts
Data Platform

JSONB Performance in Postgres 17, Measured: GIN, jsonb_path_ops, Expression Indexes and Document Size

By

November 9, 2026

8 min read

On a million documents, an expression index took a JSONB field lookup from 75 ms to 0.17 ms. On line items, jsonb_path_ops beat the default GIN operator class on every count: 1.3 ms against 4.1 ms per query, a 10% smaller index and a build 2.5 times faster. Plus what 256 KB documents cost to read and update.

Benchmark
Postgres Performance
JSONB
Containment on line items210 ms4.1 ms1.3 msn/aField equality (doc->>'email')75 msn/an/a0.17 ms

No index

GIN (jsonb_ops)

GIN (jsonb_path_ops)

Expression index

Median query time on 1 million rows, RDS Postgres 17 (log scale). Our measurements, November 2026.

The data
No indexGIN (jsonb_ops)GIN (jsonb_path_ops)Expression index
Containment on line items210 ms4.1 ms1.3 ms—
Field equality (doc->>'email')75 ms——0.17 ms

The full report covers index build times and sizes, containment on a whole-document GIN index, summing a JSONB field against a real column (99 ms against 44 ms), and reads and single-key updates on documents from 1 KB to 256 KB, where TOAST starts to show.

Leaning on JSONB in a growing table?

We'll review your schema and queries and tell you which fields should be columns or indexes. 30 minutes, free.

hoolco Monthly Review

Once a month: what changed in tech that month and what it means for you, from cloud and AI to security and the tools you build with. Every item links to its source. No sales pitch, unsubscribe in one click.

As of November 9, 2026. Provided as is, for general information, and accurate to the best of our knowledge on the date shown. Not legal, compliance, tax, financial or other professional advice. Prices, limits and vendor services change; check current vendor documentation before relying on anything here. Terms of use.