-
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: don't add reordered join to group when filters weren't pushed down
The `JoinOrderBuilder` builds reordered join plans from the bottom up, and expects filters to be pushed down as far as possible at each step. It also reuses the original matched joins when possible, to avoid duplicate work. This could previously cause filters to be dropped in the case when they weren't pushed all the way down. This commit adds a check to the `JoinOrderBuilder` to identify cases where filters weren't pushed all the way down in the original join tree. When this is true, none of the originally matched joins can be reused when reordered joins are built except for the root join. This solution may perform some duplicate work when filters aren't pushed down, but it shouldn't matter because this case is rare (and should be avoided whenever possible). Fixes #88659 Release note (bug fix): Fixed a bug introduced in 20.2 that could cause filters to be dropped from a query plan in rare cases.
- Loading branch information
1 parent
c55586b
commit 6bdb468
Showing
2 changed files
with
220 additions
and
78 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
Oops, something went wrong.