Skip to content

routing: improve dual and left joins#5551

Merged
sougou merged 1 commit intovitessio:masterfrom
planetscale:ss-routing
Dec 12, 2019
Merged

routing: improve dual and left joins#5551
sougou merged 1 commit intovitessio:masterfrom
planetscale:ss-routing

Conversation

@sougou
Copy link
Copy Markdown
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>
@sougou sougou requested review from dweitzman and systay December 12, 2019 04:54
Copy link
Copy Markdown
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