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

Improve Update and Delete Query Routing for IN Clause #6116

Merged
merged 9 commits into from
Apr 27, 2020

Conversation

harshit-gangal
Copy link
Member

@harshit-gangal harshit-gangal commented Apr 26, 2020

Fixes #5771

go/vt/vtgate/engine/update.go Outdated Show resolved Hide resolved
@@ -137,6 +140,59 @@ func (upd *Update) execUpdateEqual(vcursor VCursor, bindVars map[string]*querypb
return execShard(vcursor, upd.Query, bindVars, rs, true /* rollbackOnError */, true /* canAutocommit */)
}

func (upd *Update) execUpdateIn(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm a little concerned about the amount of shared code with execDeleteIn in delete.go. If I understand it correctly, the only difference between the two is the updateVindexEntries vs deleteVindexEntries. Isn't there a way of avoiding this much copy-pasta?

Copy link
Member Author

Choose a reason for hiding this comment

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

moved most of the part into function calls.

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.

Do not do a full scatter for DELETE or UPDATE statements with multiple PKs.
2 participants