Skip to main content Link Menu Expand (external link) Document Search Copy Copied

EXPLAIN execution statement

Prefix any valid SQL query with EXPLAIN to output an execution plan for the statement that follows.

BNF diagram

expr expr

Before you begin

Table of contents

Syntax

EXPLAIN <statement>;

Arguments

Argument Description Required? Additional information
EXPLAIN Generate an execution plan for the <statement> that follows Yes Execution plan can be downloaded as CSV

Example

EXPLAIN CREATE TABLE doctest (_id ID, stringcol STRING);

                         plan                                                |
-----------------------------------------------------------------------------+
plan
"{
    ""_op"": ""*planner.PlanOpQuery"",
    ""_schema"": [],
    ""child"": {
        ""_op"": ""*planner.PlanOpCreateTable"",
        ""ifNotExists"": false,
        ""tableName"": ""doctest""
    },
    ""sql"": ""EXPLAIN CREATE TABLE doctest (_id ID, stringcol STRING);"",
    ""warnings"": []
}"