Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

optimize_aggregation_in_order_* session settings

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 BY optimization is disabled.
  • 1 — GROUP BY optimization is enabled.

See Also

optimize_aggregation_in_order_limit

Type
Bool
Default
1
Version history
VersionDefault valueComment
26.71New 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.

Navigation