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

release-21.1: sql: add EXPLAIN (VEC) output to the stmt bundle #62049

Merged
merged 2 commits into from
Mar 16, 2021

Conversation

yuzefovich
Copy link
Member

Backport 2/2 commits from #61887.

/cc @cockroachdb/release


sql: delay saving of flows till after the setup

This commit reorders the code that deals with the flow specifications
a bit. Previously, we would call saveFlows right after generating flow
specifications and we would release the resources back to their pools
once the setup request for each flow has been sent out. However, the
follow-up commit will include the generation of EXPLAIN (VEC, VERBOSE)
diagram into the statement bundle, and to get there we need to delay
both of those actions until we know that the flows are vectorized. As
a result, now saveFlows is called after setupFlows (when we know
whether they were vectorized or not) and the release of the flow specs
is deferred.

Release note: None

sql: add EXPLAIN (VEC) output to the stmt bundle

This commit refactors the code of EXPLAIN (VEC) to be reused to add
(VEC) and (VEC, VERBOSE) flavours to the statement bundle. The code
to print the diagram is moved into colflow package, but other changes
are minor.

The addition of these diagrams is performed on the best effort basis
(meaning that if an error is encountered during populating the diagram,
the error is ignored) because in some edge cases the errors are expected
to occur.

Fixes: #47940.

Release note (sql change): Statement diagnostics bundles now contain
output of EXPLAIN (VEC) and EXPLAIN (VEC, VERBOSE) commands for the
statements.

This commit reorders the code that deals with the flow specifications
a bit. Previously, we would call `saveFlows` right after generating flow
specifications and we would release the resources back to their pools
once the setup request for each flow has been sent out. However, the
follow-up commit will include the generation of `EXPLAIN (VEC, VERBOSE)`
diagram into the statement bundle, and to get there we need to delay
both of those actions until we know that the flows are vectorized. As
a result, now `saveFlows` is called after `setupFlows` (when we know
whether they were vectorized or not) and the release of the flow specs
is deferred.

Release note: None
This commit refactors the code of `EXPLAIN (VEC)` to be reused to add
`(VEC)` and `(VEC, VERBOSE)` flavours to the statement bundle. The code
to print the diagram is moved into `colflow` package, but other changes
are minor.

The addition of these diagrams is performed on the best effort basis
(meaning that if an error is encountered during populating the diagram,
the error is ignored) because in some edge cases the errors are expected
to occur.

Release note (sql change): Statement diagnostics bundles now contain
output of `EXPLAIN (VEC)` and `EXPLAIN (VEC, VERBOSE)` commands for the
statements.
@yuzefovich yuzefovich requested a review from RaduBerinde March 15, 2021 22:16
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@yuzefovich
Copy link
Member Author

cc @cockroachdb/sql-execution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants