Commands
EXPLAIN
Use the EXPLAIN
command to show the execution plan of a statement.
Syntax
Parameters
Parameter | Description |
---|---|
statement | A statement that is executable in RisingWave. |
EXPLAIN option | See the table below. |
EXPLAIN
options
Option | Description | |
---|---|---|
VERBOSE [ TRUE | FALSE ] | Show additional information regarding the execution plan such as the table catalog of the state table and the schema of each operator. | |
TRACE [ TRUE | FALSE ] | Show the trace of each optimization stage, not only the final plan. | |
TYPE [ PHYSICAL | LOGICAL | DISTSQL ] | Show the execution plan of a specific phase.PHYSICAL — Show the batch plan or stream plan.LOGICAL — Show the optimized logical plan.DISTSQL — Show the distributed query plan for batch or stream. |
The boolean parameter [ TRUE | FALSE ]
specifies whether the specified option should be enabled or disabled. Use TRUE
to enable the option, and FALSE
to disable it. It defaults to TRUE
if the parameter is not specified.
Examples
The following statement shows the execution plan of a SELECT
statement.
The execution plan looks like this:
The following statement shows the execution plan of a CREATE MATERIALIZED VIEW
statement.
The execution plan of the statement above looks like this: