-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
opt: split disjunction in join conditions in more cases
Prior to this commit, when a join condition included a disjunction (e.g. a OR b), in some cases we could remove the disjunction by splitting the join into a UNION of joins to create a more efficient plan. However, we were only performing this transformation if at least one side of the OR predicate contained an equijoin predicate (e.g., t1.col1 = t2.col1). There were other cases where we could have improved the plan by splitting the disjunction, but we did not do so. This commit improves our ability to optimize joins with disjunctions in the join condition when there is the possibility to push one or both sides of the disjunction below the join. This commit removes the requirement that the disjunction contains an equijoin predicate, and instead splits the disjunction in all cases where it is possible to do so, thus enabling more optimization opportunities. Fixes #97695 Release note (performance improvement): if the session setting optimizer_use_improved_split_disjunction_for_joins is true, the optimizer now creates a better query plan in some cases where an inner, semi, or anti join contains a join predicate with a disjuction (OR condition).
- Loading branch information
Showing
9 changed files
with
1,836 additions
and
629 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.