These settings are available in system.settings and are autogenerated from source.
optimize_aggregation_in_order
Type
Bool
Default
0
Enables GROUP BY optimization in SELECT queries for aggregating data in corresponding order in MergeTree tables.
Possible values:
- 0 —
GROUP BYoptimization is disabled. - 1 —
GROUP BYoptimization is enabled.
See Also
optimize_aggregation_in_order_limit
Type
Bool
Default
1
Version history
| Version | Default value | Comment |
|---|---|---|
| 26.7 | 1 | New setting to push the `LIMIT` into aggregation-in-order for early termination when the `ORDER BY` is a prefix of the `GROUP BY` sort description. |
When enabled and aggregation in order is active, pushes LIMIT into the aggregation step to enable early termination after producing enough groups. This reduces the amount of data read when ORDER BY matches the GROUP BY key prefix. May reduce the value reported by rows_before_limit_at_least; use exact_rows_before_limit if exact counts are needed.