v.22.4Improvement

Improve projection analysis for optimizing count() queries

Improve projection analysis to optimize trivial queries such as count(). #35788 (Amos Bird).
Improved projection analysis in ClickHouse to optimize trivial queries such as count().

Why it matters

This feature enhances the query optimizer to better recognize and utilize existing projections for simple aggregate queries like count(). It aims to reduce query execution time and resource usage by leveraging projections more effectively for trivial queries.

How to use it

This optimization is applied automatically in ClickHouse when running trivial aggregate queries such as count(). Users do not need to enable anything manually; ensuring projections exist for the target table allows the optimizer to apply these improvements.