Skip to content
ClickHouse Docs

optimize_aggregation_in_order_* session settings

Autogenerated from ClickHouse system tables

These settings are available in system.settings and are autogenerated from the ClickHouse snapshot.

optimize_aggregation_in_order

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

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.