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

routing: improve dual and left joins #5551

Merged
merged 1 commit into from
Dec 12, 2019
Merged

Conversation

sougou
Copy link
Contributor

@sougou sougou commented Dec 12, 2019

Fixes #4772
Fixes #5508

Previously, vitess was conservative about using vindexes for tables
involving left joins. After some reasoning, we've determined that it's
actually safe (and more efficient) to use them.

In existing functionality, a reference table had to be on the RHS
of the analysis. There was no benefit if it was on the LHS. When
we changed dual to be a Reference tables, it caused a regression.
If dual was on the LHS of a join or subquery, then it would get
treated as cross-shard. The new change handles the case of ref
tables to be on the LHS. This also fixes the regression.

Signed-off-by: Sugu Sougoumarane ssougou@gmail.com

Fixes vitessio#4772
Fixes vitessio#5508

Previously, vitess was conservative about using vindexes for tables
involving left joins. After some reasoning, we've determined that it's
actually safe (and more efficient) to use them.

In existing functionality, a reference table had to be on the RHS
of the analysis. There was no benefit if it was on the LHS. When
we changed dual to be a Reference tables, it caused a regression.
If dual was on the LHS of a join or subquery, then it would get
treated as cross-shard. The new change handles the case of ref
tables to be on the LHS. This also fixes the regression.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Copy link
Collaborator

@systay systay left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants