v.22.12Improvement
Implement Aggregation-in-Order Optimization for Query Plans
Implementaggregation-in-orderoptimization on top of a query plan. It is enabled by default (but works only together withoptimize_aggregation_in_order, which is disabled by default). Setquery_plan_aggregation_in_order = 0to use the previous AST-based version. #43592 (Nikolai Kochetov).
Why it matters
This feature aims to enhance aggregation efficiency by applying theaggregation-in-order optimization on the query plan, which can lead to better query execution compared to the previous AST-based method. It solves the problem of less efficient aggregation by leveraging optimization during the query planning phase.How to use it
The optimization is enabled by default but requiresoptimize_aggregation_in_order to be enabled (disabled by default). To revert to the legacy AST-based aggregation optimization, set query_plan_aggregation_in_order = 0.