-
Notifications
You must be signed in to change notification settings - Fork 458
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
Update CBO docs to list more supported statements #4340
Conversation
9c77ef6
to
a3a12af
Compare
Direct link to the changed section of the CBO page is here. Andy, please let me know if there is:
|
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.
LGTM
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @andy-kimball and @rmloveland)
v2.2/cost-based-optimizer.md, line 36 at r1 (raw file):
{% include copy-clipboard.html %} ~~~ sql > EXPLAIN(OPT) SELECT l_shipmode, avg(l_extendedprice) from lineitem GROUP BY l_shipmode;
The default output of EXPLAIN(OPT)
has changed to show much less detail. To show more verbosity, you can use EXPLAIN(OPT,VERBOSE)
or EXPLAIN(OPT,TYPES)
. You'll need to update the sample output accordingly.
v2.2/cost-based-optimizer.md, line 61 at r1 (raw file):
~~~ In contrast, this query returns `pq: unsupported statement: *tree.Insert`, which means that it will use the legacy heuristic planner instead of the cost-based optimizer:
This is no longer true, since INSERT
is now supported by the CBO.
v2.2/cost-based-optimizer.md, line 74 at r1 (raw file):
## Types of statements supported by the cost-based optimizer The cost-based optimizer supports most SQL statements. Specifically, the following types of statements are supported:
I'd add the following to make this a more complete list:
- All SELECT statements that do not include window functions
- All UNION statements that do not include window functions
- All VALUES statements that do not include window functions
a3a12af
to
c5fb63b
Compare
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @andy-kimball)
v2.2/cost-based-optimizer.md, line 36 at r1 (raw file):
Previously, andy-kimball (Andy Kimball) wrote…
The default output of
EXPLAIN(OPT)
has changed to show much less detail. To show more verbosity, you can useEXPLAIN(OPT,VERBOSE)
orEXPLAIN(OPT,TYPES)
. You'll need to update the sample output accordingly.
I'm moving the work of updating this EXPLAIN output to #4348 in order to get the other updates live on the site for the alpha release this afternoon.
v2.2/cost-based-optimizer.md, line 61 at r1 (raw file):
Fixed by updating that paragraph to avoid using an example since that will likely change again soon. Instead it now says
In contrast, queries that are not supported by the cost-based optimizer return errors that begin with the string
pq: unsupported statement: ...
or specific messages likepq: aggregates with FILTER are not supported yet
. Such queries will use the legacy heuristic planner instead of the cost-based optimizer.
v2.2/cost-based-optimizer.md, line 74 at r1 (raw file):
Previously, andy-kimball (Andy Kimball) wrote…
I'd add the following to make this a more complete list:
- All SELECT statements that do not include window functions
- All UNION statements that do not include window functions
- All VALUES statements that do not include window functions
Fixed by adding that information to the list - thanks Andy!
A bit more work to address #3998. Summary of changes: - Edit the 'Supported statements' section of the ['Cost-based Optimizer'][1] page as follows: - Add DELETE per cockroachdb/cockroach#34522 - Add `INSERT .. ON CONFLICT` variants per cockroachdb/cockroach#33339 - Add `SELECT`, `VALUES`, and `UNION` statements that do not include window functions - Add FILTER clause on aggregate functions per cockroachdb/cockroach#34077 - Remove `experimental_optimizer_updates` cluster setting [1]: http://www.cockroachlabs.com/docs/v2.2/cost-based-optimizer.html
c5fb63b
to
7fbce7b
Compare
A bit more work to address #3998.
Summary of changes:
Edit the 'Supported statements' section of the 'Cost-based
Optimizer' page as follows:
Add
FILTER
per opt: add support for aggregate FILTER cockroach#34077Add
DELETE
per opt: Prune Update and Upsert input columns cockroach#34522Add
INSERT .. ON CONFLICT
variants per opt: Add optimizer support for UPSERT and INSERT..ON CONFLICT statements cockroach#33339Remove
experimental_optimizer_updates
cluster setting (can't finda commit for this, but I don't see it in
SHOW ALL
output on mylocal build of yesterday's
master
, version number isv2.2.0-alpha.20181217-1096-gd104dcee69-dirty
.