hn.today

PostgreSQL 18.7 and 19.0: Expression Aggregates 31.6% Slower

thestacksentinel.com10 points2 comments
Screenshot of PostgreSQL 18.7 and 19.0: Expression Aggregates 31.6% Slower

A benchmark comparing PostgreSQL 18.7 with 19.0 found that the upgrade’s effect depended on query shape. Across seven comparisons, five showed no clear performance difference, including data loading, pgbench read-only and read-write workloads, a general GROUP BY, and a top-100 sort. A filtered count over 10 million rows improved from 201 ms on 18.7 to 168 ms on 19.0, a 16.4% speedup. In contrast, an expression-heavy aggregate over the same number of rows worsened from 701 ms to 923 ms, or 31.6% slower. The results highlight that broad claims about a release’s speed do not predict performance for every analytical query.

The benchmark also tested PostgreSQL 19.0 with JIT compilation enabled, reflecting release guidance that users with large analytical queries may want to turn it on. JIT reduced the expression-heavy aggregate’s time to 732 ms, 20.7% faster than the default 19.0 result and not clearly different from 18.7. However, it slowed the filtered count by 16.7%, from 168 ms to 196 ms, so enabling JIT did not help all workloads. Measurements were medians from 11 rounds on one Ryzen 7 desktop, with data held in memory and containers limited to eight cores and 6 GB of memory. The results are therefore a reason to test representative queries during upgrades, not a guarantee of behavior on other systems.

Read on thestacksentinel.com2 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Lua as a Query Language

Lua as a Query Language

Lua can serve as a dynamic query language by expressing relational operations as Lua code that builds an AST for a Rust backend, avoiding a custom parser and Rust recompilation for ad hoc queries. Lua variables provide reusable views and built-in language features support query constructs such as filters and arithmetic. (remy.wang)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.