Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document explain format [text | json] #137

Merged
merged 3 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/product-lifecycle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Below is a list of all features in the public preview phase:

| Feature name | Start version |
| :-- | :-- |
| [EXPLAIN FORMAT JSON](/sql/commands/sql-explain#explain-options)| 2.2 |
| [Ingest data from Postgres table](/integrations/sources/postgresql-table) | 2.1 |
| [Ingest data from webhook](/integrations/sources/webhook) | 2.1 |
| [Shared source](/sql/commands/sql-create-source#shared-source) | 2.1 |
Expand Down
18 changes: 13 additions & 5 deletions sql/commands/sql-explain.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,24 @@ EXPLAIN [ ( option [ , ... ] ) ] statement;

#### `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. |
| Option | Supported values | 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.<ul><li>PHYSICAL — Show the batch plan or stream plan.</li><li>LOGICAL — Show the optimized logical plan.</li><li>DISTSQL — Show the distributed query plan for batch or stream.</li></ul> |
| **FORMAT** | `[ TEXT \| JSON ]` | <ul><li>FORMAT JSON - Show the `logical` and `physical` plans in JSON format while ignoring `trace` and `distsql` options.</li><li>FORMAT TEXT - Match the current output format of `EXPLAIN`.</li></ul> |

<Note>
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.
</Note>

<Note>
**PUBLIC PREVIEW**

`EXPLAIN FORMAT JSON` is currently in public preview, meaning it is nearing the final product but may not yet be fully stable. If you encounter any issues or have feedback, please reach out to us via our [Slack channel](https://www.risingwave.com/slack). Your input is valuable in helping us improve this feature. For more details, see our [Public Preview Feature List](/changelog/product-lifecycle#features-in-the-public-preview-stage).

</Note>

## Examples

The following statement shows the execution plan of a `SELECT` statement.
Expand Down
Loading