-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Gen4 fallback planning #7370
Gen4 fallback planning #7370
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>
go/vt/vtgate/planbuilder/builder.go
Outdated
case Gen4WithFallback: | ||
fp := &fallbackPlanner{ | ||
primary: buildSelectPlan, | ||
fallback: gen4Planner, | ||
} | ||
return fp.plan |
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.
primary should be gen4, right?
go/vt/vtgate/planbuilder/builder.go
Outdated
// 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()) | ||
} | ||
} |
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: error can be added as return type to avoid creating this method.
filenames := []string{"large_cases.txt"} | ||
vschema := &vschemaWrapper{ |
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.
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) { |
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 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>
Tries using the gen4 planner, and if that fails, uses the v3 planner instead.