Skip to content

vreplication: improved rowstreamer#5130

Merged
sougou merged 2 commits intovitessio:masterfrom
planetscale:ss-vrepl-rowstreamer-fix
Sep 4, 2019
Merged

vreplication: improved rowstreamer#5130
sougou merged 2 commits intovitessio:masterfrom
planetscale:ss-vrepl-rowstreamer-fix

Conversation

@sougou
Copy link
Copy Markdown
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 ssougou@gmail.com

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 <ssougou@gmail.com>
@sougou sougou requested review from acharis, deepthi and morgo August 24, 2019 17:44
Copy link
Copy Markdown
Collaborator

@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
Copy Markdown
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 <ssougou@gmail.com>
Copy link
Copy Markdown
Collaborator

@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