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

vreplication: improved rowstreamer #5130

Merged
merged 2 commits into from
Sep 4, 2019

Conversation

sougou
Copy link
Contributor

@sougou sougou commented Aug 24, 2019

For composite primary keys, mysql comes up with a full table scan
for conditions like (pk1,pk2) > (1, 2).
This change rewrites that condition to:
(pk1 = 1 and pk2 > 2) or (pk1 > 1)

Also removed the autocommit=0. It's not material to set that for
obtaining read locks.

Signed-off-by: Sugu Sougoumarane [email protected]

For composite primary keys, mysql comes up with a full table scan
for conditions like (pk1,pk2) > (1, 2).
This change rewrites that condition to:
(pk1 = 1 and pk2 > 2) or (pk1 > 1)

Also removed the autocommit=0. It's not material to set that for
obtaining read locks.

Signed-off-by: Sugu Sougoumarane <[email protected]>
@sougou sougou requested review from deepthi, morgo and acharis August 24, 2019 17:44
Copy link
Member

@deepthi deepthi left a comment

Choose a reason for hiding this comment

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

It is obvious that the code can handle an arbitrary number of PK columns. The tests currently have 1 or 2 PKs. What do you think of adding a test with 3 PK columns?
Looks good otherwise.

@sougou
Copy link
Contributor Author

sougou commented Aug 26, 2019

I thought about that. Was borderline on the 3-pk case. I can add a test.

Signed-off-by: Sugu Sougoumarane <[email protected]>
Copy link
Member

@deepthi deepthi left a comment

Choose a reason for hiding this comment

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

+1

@sougou sougou merged commit ca686af into vitessio:master Sep 4, 2019
@sougou sougou deleted the ss-vrepl-rowstreamer-fix branch September 5, 2019 04:00
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.

2 participants