release-21.1: sql: add EXPLAIN (VEC) output to the stmt bundle #62049
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 flowspecifications 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 aftersetupFlows
(when we knowwhether 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 codeto print the diagram is moved into
colflow
package, but other changesare 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)
andEXPLAIN (VEC, VERBOSE)
commands for thestatements.