Updated on 2026-11-06 GMT+08:00

View Plan

Function

Executing this statement returns the physical execution plan for the specified SQL statement. When the EXTENDED keyword is specified, both the logical plan and the physical execution plan are output.

Syntax

1
EXPLAIN [EXTENDED | CODEGEN] statement;

Keywords

EXTENDED: When this keyword is specified, both the logical plan and the physical execution plan are output.

CODEGEN: When this keyword is specified, code generated by codegen is also output, if any.

Precautions

None.

Example

Return the logical plan and physical execution plan for the SQL statement SELECT * FROM test.

1
EXPLAIN EXTENDED select * from test;