--- title: "EXPLAIN PLAN" description: "Reference page for `EXPLAIN PLAN`. `EXPLAIN PLAN` is used to inspect the plans of `SELECT` statements, indexes, and materialized views." aliases: - /sql/explain/ menu: main: parent: commands --- `EXPLAIN PLAN` displays the plans used for: | | | |-----------------------------|-----------------------| | | | {{< warning >}} `EXPLAIN` is not part of Materialize's stable interface and is not subject to our backwards compatibility guarantee. The syntax and output of `EXPLAIN` may change arbitrarily in future versions of Materialize. {{< /warning >}} ## Syntax {{< tabs >}} {{< tab "FOR SELECT">}} ```mzsql EXPLAIN [ [ RAW | DECORRELATED | [LOCALLY] OPTIMIZED | PHYSICAL ] PLAN [ WITH ( [, ...])] [ AS TEXT | AS JSON ] FOR ] -- The FOR keyword is required if the PLAN keyword is specified