v.23.10New Feature

New Setting: force_optimize_projection_name to Validate Projection Usage in Queries

A new setting called force_optimize_projection_name, it takes a name of projection as an argument. If it's value set to a non-empty string, ClickHouse checks that this projection is used in the query at least once. Closes #55331. #56134 (Yarik Briukhovetskyi).
Introduced a new setting force_optimize_projection_name that enforces the usage of a specified projection in query optimization.

Why it matters

This feature ensures that a particular projection is applied in query execution by verifying that the projection is used at least once in the query. It helps users guarantee that specific projections are leveraged, improving control over query optimization and performance.

How to use it

Set the force_optimize_projection_name setting to the name of the desired projection as a non-empty string. ClickHouse will then check that this projection is used in query optimization during query execution.