Merged
Conversation
This way we can compose planners in more ways. Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
harshit-gangal
approved these changes
Jan 28, 2021
go/vt/vtgate/planbuilder/builder.go
Outdated
Comment on lines
+116
to
+121
| case Gen4WithFallback: | ||
| fp := &fallbackPlanner{ | ||
| primary: buildSelectPlan, | ||
| fallback: gen4Planner, | ||
| } | ||
| return fp.plan |
Member
There was a problem hiding this comment.
primary should be gen4, right?
go/vt/vtgate/planbuilder/builder.go
Outdated
Comment on lines
+123
to
+128
| // fail - unknown planner | ||
| return func(query string) func(sqlparser.Statement, ContextVSchema) (engine.Primitive, error) { | ||
| return func(sqlparser.Statement, ContextVSchema) (engine.Primitive, error) { | ||
| return nil, vterrors.Errorf(vtrpcpb.Code_INTERNAL, "unknown planner selected %d", vschema.Planner()) | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
nit: error can be added as return type to avoid creating this method.
Comment on lines
598
to
599
| filenames := []string{"large_cases.txt"} | ||
| vschema := &vschemaWrapper{ |
Member
There was a problem hiding this comment.
is this removed on purpose?
go/vt/vtgate/planbuilder/builder.go
Outdated
| func createInstructionFor(query string, stmt sqlparser.Statement, vschema ContextVSchema) (engine.Primitive, error) { | ||
| type selectPlanner func(query string) func(sqlparser.Statement, ContextVSchema) (engine.Primitive, error) | ||
|
|
||
| func createInstructionFor(query string, stmt sqlparser.Statement, vschema ContextVSchema, sel selectPlanner) (engine.Primitive, error) { |
Member
There was a problem hiding this comment.
I think we do not need to pass selectPlanner here and getConfiguredPlanner(vschema) can be used directly.
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Tries using the gen4 planner, and if that fails, uses the v3 planner instead.