v.22.7Improvement
New rewrite Option in EXPLAIN AST to Show Rewritten AST
New optionrewriteinEXPLAIN AST. If enabled, it shows AST after it's rewritten, otherwise AST of original query. Disabled by default. #38910 (Igor Nikonov).
Why it matters
This feature provides users with the ability to see the rewritten version of the query's AST, helping to better understand how ClickHouse transforms queries internally for optimization and execution. It aids in debugging and optimizing query behavior by comparing the original and rewritten AST.How to use it
Use theEXPLAIN AST command with the rewrite option enabled to view the AST after rewriting. By default, this option is disabled and only shows the original AST. Example:EXPLAIN AST rewrite <your_query>