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

Gen4: Add UPDATE planning #9871

Merged
merged 35 commits into from
Apr 13, 2022
Merged

Gen4: Add UPDATE planning #9871

merged 35 commits into from
Apr 13, 2022

Conversation

harshit-gangal
Copy link
Member

@harshit-gangal harshit-gangal commented Mar 11, 2022

Description

Uses the gen4 planner infrastructure to plan UPDATE statements. This makes it possible to plan more queries - UPDATE with subqueries are now possible.

Unfortunately we still have the limitation that only a minority of correlated subqueries are possible - only when we can merge the UPDATE with the subquery into a single route can we perform these queries.

Related Issue(s)

#9640

Checklist

  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes


@harshit-gangal harshit-gangal added Type: Enhancement Logical improvement (somewhere between a bug and feature) Component: Query Serving release notes labels Mar 11, 2022
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
… skip]

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
…skip]

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
frouioui and others added 18 commits April 5, 2022 13:46
…p) [ci skip]

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
@systay systay marked this pull request as ready for review April 10, 2022 08:56
@systay systay changed the title Gen4: Update statement planner Gen4: Add UPDATE planning Apr 10, 2022
Copy link
Member

@frouioui frouioui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! 👍🏻

go/vt/vtgate/planbuilder/physical/dml_planning.go Outdated Show resolved Hide resolved
}

if r.RouteOpCode == engine.Scatter && op.AST.Limit != nil {
// TODO systay: we should probably check for other op code types - IN could also hit multiple shards (2022-04-07)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's create an issue for this for tracking.

Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
…ressions

Signed-off-by: Andres Taylor <andres@planetscale.com>
… UNION

Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Copy link
Member Author

@harshit-gangal harshit-gangal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good overall.

go/test/endtoend/vtgate/queries/subquery/subquery_test.go Outdated Show resolved Hide resolved
go/vt/vtgate/executor_dml_test.go Show resolved Hide resolved
go/vt/vtgate/planbuilder/physical/route.go Outdated Show resolved Hide resolved
}

if r.RouteOpCode == engine.Scatter && op.AST.Limit != nil {
// TODO systay: we should probably check for other op code types - IN could also hit multiple shards (2022-04-07)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's create an issue for this for tracking.

go/vt/vtgate/planbuilder/primitive_builder.go Outdated Show resolved Hide resolved
go/vt/vtgate/planbuilder/testdata/dml_cases.txt Outdated Show resolved Hide resolved
go/vt/vtgate/planbuilder/testdata/dml_cases.txt Outdated Show resolved Hide resolved
go/vt/vtgate/planbuilder/testdata/unsupported_cases.txt Outdated Show resolved Hide resolved
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Query Serving Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants