v.22.4Improvement
Improve projection analysis for optimizing count() queries
Improve projection analysis to optimize trivial queries such as count(). #35788 (Amos Bird).Why it matters
This feature enhances the query optimizer to better recognize and utilize existing projections for simple aggregate queries likecount(). 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 ascount(). Users do not need to enable anything manually; ensuring projections exist for the target table allows the optimizer to apply these improvements.