-
Notifications
You must be signed in to change notification settings - Fork 474
identify all statements that can be EXPLAINed #2682
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
Conversation
v1.0/explain.md
Outdated
- [`ALTER TABLE`](alter-table.html) | ||
- [`CREATE`](sql-grammar.html#create_stmt) | ||
- [`DELETE`](delete.html) | ||
- [`HELP`](sql-grammar.html#help_stmt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove HELP, it was not meant to be documented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
v1.0/explain.md
Outdated
- [`INSERT`](insert.html) | ||
- [`SELECT`](select.html) | ||
- [`SHOW`](sql-grammar.html#show_stmt) | ||
- [`SPLIT`](sql-grammar.html#split_stmt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no "SPLIT" statement, it's a special form of ALTER.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
v1.0/explain.md
Outdated
|
||
You can use `EXPLAIN` on the following statements: | ||
|
||
- [`ALTER TABLE`](alter-table.html) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all the forms of ALTER can be explained, not just ALTER TABLE. Or perhaps that was not true in 1.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also put the various ALTER statements on the same line with proper doc links like this:
- [`ALTER TABLE`](alter-table.html), [`ALTER INDEX`](alter-index.html), ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the full SQL grammar, only ALTER TABLE is explainable in 1.0. I'll update the following versions with how you suggested though.
v1.0/explain.md
Outdated
- [`SELECT`](select.html) | ||
- [`SHOW`](sql-grammar.html#show_stmt) | ||
- [`SPLIT`](sql-grammar.html#split_stmt) | ||
- [`UPDATE`](update.html) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add EXPLAIN to this list too (EXPLAIN is explainable)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
v2.0/explain.md
Outdated
- [`SET CLUSTER SETTING`](set-cluster-setting.html) | ||
- [`SHOW`](sql-grammar.html#show_stmt) | ||
- [`UPDATE`](update.html) | ||
- [`UPSERT`](upsert.html) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add EXPLAIN to this list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
v1.1/explain.md
Outdated
- [`EXECUTE`](sql-grammar.html#execute_stmt) | ||
- [`IMPORT`](sql-grammar.html#import_stmt) | ||
- [`PAUSE JOB`](sql-grammar.html#pause_stmt) | ||
- [`RESET`](sql-grammar.html#reset_stmt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
link reset-vars.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
v1.1/explain.md
Outdated
- [`PAUSE JOB`](sql-grammar.html#pause_stmt) | ||
- [`RESET`](sql-grammar.html#reset_stmt) | ||
- [`RESTORE`](restore.html) | ||
- [`RESUME JOB`](sql-grammar.html#resume_stmt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
link resume-job.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
v1.1/explain.md
Outdated
- [`RESTORE`](restore.html) | ||
- [`RESUME JOB`](sql-grammar.html#resume_stmt) | ||
- [`SELECT`](select.html) | ||
- [`SET SESSION`](sql-grammar.html#set_session_stmt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
link set-vars.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
v1.1/explain.md
Outdated
- [`SELECT`](select.html) | ||
- [`SET SESSION`](sql-grammar.html#set_session_stmt) | ||
- [`SET CLUSTER SETTING`](set-cluster-settings.html) | ||
- [`SHOW`](sql-grammar.html#show_stmt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
list the various SHOW pages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
v2.0/explain.md
Outdated
|
||
<div id="toc"></div> | ||
|
||
## Explainable Statements | ||
|
||
- [`ALTER`](sql-grammar.html#alter_stmt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto precise page links as for 1.1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only a few suggestions on top of @knz's.
|
||
<div id="toc"></div> | ||
|
||
## Explainable Statements | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's us an intro sentence like you have in the 1.1 version of the page:
You can use
EXPLAIN
on the following statements:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
v1.0/explain.md
Outdated
@@ -4,10 +4,24 @@ summary: The EXPLAIN statement provides information you can use to optimize SQL | |||
toc: false | |||
--- | |||
|
|||
The `EXPLAIN` [statement](sql-statements.html) returns CockroachDB's query plan to execute [`DELETE`](delete.html), [`INSERT`](insert.html), [`SELECT`](select.html) or [`UPDATE`](update.html) statements. You can then use this information to optimize those queries. | |||
The `EXPLAIN` [statement](sql-statements.html) returns CockroachDB's query plan to execute the [explainable statements](#explainable-statments). You can then use this information to optimize those queries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: to execute the explainable statements
> for an explainable statement
.
Also, I'd tweak the second sentence a bit: You can then use this information to optimize the query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please apply this change to other versions of the page as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
v1.0/explain.md
Outdated
@@ -4,10 +4,23 @@ summary: The EXPLAIN statement provides information you can use to optimize SQL | |||
toc: false | |||
--- | |||
|
|||
The `EXPLAIN` [statement](sql-statements.html) returns CockroachDB's query plan to execute [`DELETE`](delete.html), [`INSERT`](insert.html), [`SELECT`](select.html) or [`UPDATE`](update.html) statements. You can then use this information to optimize those queries. | |||
The `EXPLAIN` [statement](sql-statements.html) returns CockroachDB's query plan for an [explainable statements](#explainable-statements). You can then use this information to optimize the query. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explainable statements
> explainable statement
v1.1/explain.md
Outdated
@@ -4,10 +4,34 @@ summary: The EXPLAIN statement provides information you can use to optimize SQL | |||
toc: false | |||
--- | |||
|
|||
The `EXPLAIN` [statement](sql-statements.html) returns CockroachDB's query plan to execute [`DELETE`](delete.html), [`INSERT`](insert.html), [`SELECT`](select.html) or [`UPDATE`](update.html) statements. You can then use this information to optimize those queries. | |||
The `EXPLAIN` [statement](sql-statements.html) returns CockroachDB's query plan for an [explainable statements](#explainable-statements). You can then use this information to optimize the query. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explainable statements
> explainable statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
v2.0/explain.md
Outdated
@@ -4,10 +4,35 @@ summary: The EXPLAIN statement provides information you can use to optimize SQL | |||
toc: false | |||
--- | |||
|
|||
The `EXPLAIN` [statement](sql-statements.html) returns CockroachDB's query plan to execute [`DELETE`](delete.html), [`INSERT`](insert.html), [`SELECT`](select.html) or [`UPDATE`](update.html) statements. You can then use this information to optimize those queries. | |||
The `EXPLAIN` [statement](sql-statements.html) returns CockroachDB's query plan for an [explainable statements](#explainable-statements). You can then use this information to optimize the query. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explainable statements
> explainable statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something in the v2.0 page seems to have messed up the page after the diagram: http://cockroach-docs-review.s3-website-us-east-1.amazonaws.com/f631d5df0657fbfdedf70a32f96abcaf6e3a7ed1/dev/explain.html#synopsis
Can you wrap the diagram in <section>
tags and see if that fixes the problem?
<section>{% include sql/{{ page.version.version }}/diagrams/explain.html %}</section>
1 similar comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we need to update the explainable_stmt
description under "Parameters" and the See Also
list as well, on all versions of the page. For See Also
, no need to list all statements that can be explained, I think.
fix broken links fix broken link
LGTM, @lhirata! |
Closes #1963.