v.21.1New Features

EXPLAIN AST Now Supports Non-SELECT Queries

EXPLAIN AST now support queries other then SELECT. #18136 (taiyang-li).
EXPLAIN AST now supports queries other than SELECT.

Why it matters

Previously, EXPLAIN AST was limited to only SELECT queries, restricting users from inspecting the Abstract Syntax Tree (AST) of other query types. This feature expands the capability to analyze and understand the syntax structure of a broader range of queries, enhancing debugging and query optimization.

How to use it

Use the EXPLAIN AST statement followed by any query type (not only SELECT). For example:

EXPLAIN AST INSERT INTO table_name VALUES (1, 'value');

This will output the AST for the specified query.