DATABASES Signal 504
ClickHouse Release 26.7
ClickHouse 26.7 adds a LIMIT pushdown into its ordered-aggregation pipeline, turning the common GROUP BY ... ORDER BY ... LIMIT pattern into a streaming, early-terminating query when the GROUP BY key is a leading prefix of the table's sort key.
For engineers running analytics on large fact tables, Top-N queries that also need per-group aggregation are some of the most common and expensive patterns in production; this release can drop both wall time and memory by orders of magnitude for those queries, but only on tables whose sort key aligns with the GROUP BY columns. The rest of the release is a typical monthly drop covering vector search, phrase search, JOIN work, and a new EXPLAIN ANALYZE diagnostic.
Written by elseif from the cluster below · every claim links back to a sourceThe three things worth knowing
A new optimize_aggregation_in_order_limit setting extends ClickHouse's existing in-order aggregation so that input scanning stops once N groups have been emitted, fusing GROUP BY, ORDER BY, and LIMIT into a single streaming pipeline.
The optimization only fires when the GROUP BY key is a prefix of the table's sort key, so the benefit depends on ingestion layout rather than on the query alone.
Beyond that headline change, 26.7 includes four vector search improvements (one tied to a QBit type), position-aware phrase search, EXPLAIN ANALYZE, a unified URL function family, three JOIN improvements, and a total of 61 new features, 112 performance optimizations, and 329 bug fixes.
THE READ
What the cluster adds up to.
The headline change in 26.7 is a single, targeted optimization flag named optimize_aggregation_in_order_limit. ClickHouse already shipped optimize_aggregation_in_order, which lets the engine aggregate a single group at a time when the GROUP BY key matches a prefix of the table's sort key; that on its own already removes the need to keep every group in memory. The new flag extends the same pipeline with a LIMIT pushdown, so once N complete groups have been emitted, input reading stops. The practical effect is that the canonical 'first N rows by key, with a per-group aggregate' pattern becomes a streaming operation that can return its last row before the full table has been read. This is a narrow change to one query shape rather than a general rewrite of the aggregation layer.
The release's own benchmark, run on TPC-H at scale factor 100 on an m6i.8xlarge with 32 vCPUs and 128 GiB of RAM, reports the same order-summary query dropping from roughly 2.8 seconds and about 17.3 GiB of peak memory to 0.009 seconds and a few tens of megabytes, quoted in the post as a 313× speedup and 592× memory reduction. The query groups and orders by l_orderkey, the leading sort key of the lineitem table, which is exactly the pattern the optimization targets. Independent corroboration of those numbers is not present in the material I have, and the optimized-path results in the extract cut off mid-run, so the three-run averages behind the headline figures are not visible to me.
The adoption cost is essentially zero for tables that already sort by the columns your Top-N queries group on, which is the typical design for analytics fact tables. The gain evaporates the moment the GROUP BY key stops being a sort-key prefix, because there is no longer a 'current group' for the engine to finalize and the LIMIT has nothing early to push down. Nothing in the release notes promises a runtime sort or background reorganization to recover the benefit, so this is a layout-driven optimization, not a query-driven one. The flag is also described as opt-in, and any plan regression in 26.7 will need EXPLAIN ANALYZE, itself new in this release, to diagnose.
Outside the headline, 26.7 also ships four vector search improvements, one of which is tied to a QBit type that the release describes as faster vector search, plus position-aware phrase search, three JOIN improvements of unspecified scope, EXPLAIN ANALYZE as a new execution diagnostic, and a unified URL function family that consolidates URL handling. The release is a monthly drop carrying 61 new features, 112 performance optimizations, and 329 bug fixes. It also credits a long list of new contributors, which is the only signal in the material about the size of the active development community behind the engine.
Coverage of this event comes from a single feed, the ClickHouse release notes, so the framing is entirely from the vendor. That matters because release-post benchmarks are typically chosen to showcase the optimization, and the headline numbers above should be read as an upper bound on the gain for a workload that already matches the precondition. The functional facts, the flag name, its sort-key precondition, the surrounding feature names, and the version number, are independently verifiable from the changelog once 26.7 is installed, but the magnitude claim is not cross-checked by any other source in this material.
Written by elseif from the cluster below · checked for specifics the sources never containedTHE CLUSTER
↗