v.21.3Improvement

Normalize count(constant) and sum(1) to count() for Projection Query Routing

Normalize count(constant), sum(1) to count(). This is needed for projection query routing. #20175 (Amos Bird).
Normalize aggregate functions like count(constant) and sum(1) to count() for improved projection query routing.

Why it matters

This feature solves the problem of inconsistent aggregate function expressions by standardizing them to a single form. It enhances projection query routing by allowing ClickHouse to better recognize equivalent aggregate queries, improving query optimization and execution efficiency.

How to use it

This normalization is applied automatically in ClickHouse when using aggregate functions within queries, particularly during projection query routing. Users do not need to enable or configure this feature explicitly.