v.23.3Improvement

Improved Projection Analysis with Query Plan Optimization Setting

This improvement should be invisible for users. Re-implement projection analysis on top of query plan. Added setting query_plan_optimize_projection=1 to switch between old and new version. Fixes #44963. #46537 (Nikolai Kochetov).
Re-implemented projection analysis on top of the query plan with an option to toggle between the old and new implementations using the setting query_plan_optimize_projection=1.

Why it matters

This feature aims to improve the internal mechanism of projection analysis in query execution. By re-implementing it on top of the query plan, the change enhances query optimization transparency and maintainability while keeping user experience unchanged. It addresses issues related to the previous implementation, as referenced in #44963.

How to use it

To enable the new projection analysis, set the query_plan_optimize_projection setting to 1 in your query or configuration file before executing your queries. This allows switching between the legacy and new projection analysis methods seamlessly.