v.25.6Improvement

EXPLAIN SYNTAX now uses a new analyzer

EXPLAIN SYNTAX now uses a new analyzer. It returns AST built from the query tree. Added option query_tree_passes to control the number of passes to executed before converting query tree to the AST. #74536 (Vladimir Cherkasov).
EXPLAIN SYNTAX now uses a new analyzer that returns an Abstract Syntax Tree (AST) built from the query tree, enhancing query analysis detail and accuracy.

Why it matters

The update improves the internal query analysis by reconstructing the AST from the query tree, allowing better insight into query structure. The addition of the query_tree_passes option enables users to control how many optimization passes are executed before the AST conversion, offering more precise diagnostics and flexibility in understanding query transformations.

How to use it

Use EXPLAIN SYNTAX on your query as usual. To customize the number of optimization passes before AST generation, set the query_tree_passes option with the desired number, for example:

EXPLAIN SYNTAX SETTINGS query_tree_passes = 3
SELECT * FROM table

This controls how many passes the analyzer performs before outputting the AST.