Skip to content

Commit 591f3bf

Browse files
author
Lauren
committed
Edits based on feedback
1 parent 38f51ff commit 591f3bf

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

v2.1/explain.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ Using `EXPLAIN`'s output, you can optimize your queries by taking the following
3838

3939
- Queries with fewer levels execute more quickly. Restructuring queries to require fewer levels of processing will generally improve performance.
4040

41+
- To view the distributed SQL query plan with execution statistics, use `EXPLAIN ANALYZE (DISTSQL)`.
42+
4143
- Avoid scanning an entire table, which is the slowest way to access data. You can avoid this by [creating indexes](indexes.html) that contain at least one of the columns that the query is filtering in its `WHERE` clause.
4244

4345
You can find out if your queries are performing entire table scans by using `EXPLAIN` to see which:
@@ -60,14 +62,14 @@ The user requires the appropriate [privileges](privileges.html) for the statemen
6062

6163
Parameter | Description
6264
-----------|-----------
63-
`ANALYZE` | Carry out the command and show execution statistics.
65+
`ANALYZE` | <span class="version-tag">New in v2.1:</span> Execute the command and show execution statistics.
6466
`EXPRS` | Include the SQL expressions that are involved in each processing stage.
6567
`QUALIFY` | Include table names when referencing columns, which might be important to verify the behavior of joins across tables with the same column names.<br/><br/>To list qualified names, `QUALIFY` requires you to include the `EXPRS` option.
6668
`METADATA` | Include the columns each level uses in the **Columns** column, as well as **Ordering** detail.
6769
`VERBOSE` | Imply the `EXPRS`, `METADATA`, and `QUALIFY` options.
6870
`TYPES` | Include the intermediate [data types](data-types.html) CockroachDB chooses to evaluate intermediate SQL expressions. <br/><br/>`TYPES` also implies `METADATA` and `EXPRS` options.
69-
`OPT` | Display a query plan tree if the query will be run with the [cost-based optimizer](sql-optimizer.html). If it returns `pq: unsupported statement: *tree.Insert`, the query will not be run with the cost-based optimizer and will be run with the heuristic planner.
70-
`DISTSQL` | Provide a link that displays a distributed SQL plan tree.
71+
`OPT` | <span class="version-tag">New in v2.1:</span> Display a query plan tree if the query will be run with the [cost-based optimizer](sql-optimizer.html). If it returns `pq: unsupported statement: *tree.Insert`, the query will not be run with the cost-based optimizer and will be run with the heuristic planner.
72+
`DISTSQL` | <span class="version-tag">New in v2.1:</span> Provide a link that displays a distributed SQL plan tree.
7173
`explainable_stmt` | The [statement](#explainable-statements) you want details about.
7274

7375
{{site.data.alerts.callout_danger}}<code>EXPLAIN</code> also includes other modes besides query plans that are useful only to CockroachDB developers, which are not documented here.{{site.data.alerts.end}}
@@ -369,7 +371,7 @@ The query above will not be run with the cost-based optimizer.
369371

370372
### `DISTSQL` option
371373

372-
<span class="version-tag">New in v2.1:</span> The `DISTSQL` option provides a link to a distributed query plan tree and point your browser to the URL provided:
374+
<span class="version-tag">New in v2.1:</span> The `DISTSQL` option provides a link to a distributed query plan tree:
373375

374376
{% include copy-clipboard.html %}
375377
~~~ sql

0 commit comments

Comments
 (0)