[Gen4] Merge SeenPredicates when creating route operator for join#11104
Merged
systay merged 2 commits intovitessio:mainfrom Sep 12, 2022
Merged
Conversation
Without merging the `SeenPredicates` lists when merging two routes for a join we'd potetnially lose track of predicates to use for vindex selection when routing information was reset. Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
When merging an inner query with its outer query, we can remove the inner query from the list of predicates that can influence routing of the outer query. Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
Contributor
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
SeenPredicates when creating route operator for join
3 tasks
systay
approved these changes
Sep 12, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In the Gen4 planner,
Routestructs hold a list of predicates that can influence the routing decisions (SeenPredicates). When merging inner queries into their outer query, vindex predicates are reset and their options are rebuild from this list of seen predicates.Unfortunately, when a route object was build for an
ApplyJoinoperator, the lists ofSeenPredicatesfrom the left and right parts of the join were not copied over into the new route object. If a subquery was then merged into thisRoute, the vindex predicate options could not be rebuild and the resulting route would become aScatter.By merging the
SeenPredicateslists of both sides of the join, we can ensure that the vindex predicate reset actually works correctly, and the correct vindex is used for routing.Related Issue(s)
This is an alternative (and arguably simpler) fix to #11072.
This fixes #10823.
Checklist