PostgreSQL Aggregation Processing Speed
blog.kagamino.dev·4h·
Discuss: Hacker News

06/10/2025 - Estimated reading time: 7 minutes — PostgreSQL

Key takeaways

JSON is more efficient than JSONB when only reading data

JSONB is useful for data processing, when filtering data on the database. But in this test, the higher cost of creating JSONB is not worth it, and there is also a price to convert it back to text.

Use composite binary for Python data processing

If you need to compute further in Python, the raw speed of composite binary on Postgres and the OK part in Python makes it the fastest to get data in processable data structures. You can even cast the output in a typed NamedTuple and won’t need manual parsing

The problem

Most of the time, the rows of a SQL query matches the domain: a list of…

Similar Posts

Loading similar posts...