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

Gen4: improvement of joinTree creation #8822

Merged
merged 12 commits into from
Sep 18, 2021
Merged

Conversation

frouioui
Copy link
Member

Description

This pull request contains a bug fix for #8813. The bug happens when we join two queryTrees to create a joinTree.

When pushing a join predicate on a joinTree (pushJoinPredicate), we're looking in the predicate for a ColName that LHS solves, once we find the ColName, we add it to LHS's columns, and we add it into our joinTree's JoinVars.

Then, we create an argument for this new column, along with a new predicate containing the argument and the second column of our join predicate, which is solved by RHS. This new predicate is pushed to RHS using the same function pushJoinPredicate.

However, if RHS is also a joinTree we try to push the predicate as an output column, meaning that we will create new output columns in RHS, and this is done in a recursive fashion (i.e if RHS's RHS is also a joinTree). Instead, we can add the predicate to the first route we find in RHS that solves it, avoiding the creation of unrequired output columns.

Related Issue(s)

Checklist

  • Tests were added or are not required
  • Documentation was added or is not required

@GuptaManan100
Copy link
Member

@frouioui the sizegen test is failing. I tried running make codegen locally and nothing changed for me! I don't know why it is failing. We should take a look

Signed-off-by: Manan Gupta <[email protected]>
Copy link
Member

@GuptaManan100 GuptaManan100 left a comment

Choose a reason for hiding this comment

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

LGTM! 😺

@systay systay merged commit 2a28a90 into vitessio:main Sep 18, 2021
@systay systay deleted the gen4-fix-8813 branch September 18, 2021 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect Join Vars in Gen4 plan
3 participants