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

release-21.2: opt: fix missing filters after join reordering #76619

Merged
merged 1 commit into from
Feb 15, 2022

Commits on Feb 15, 2022

  1. opt: fix missing filters after join reordering

    This commit eliminates logic in the `assoc`, `leftAsscom`, and
    `rightAsscom` functions in the join order builder that aimed to prevent
    generating "orphaned" predicates, where one or more referenced relations
    are not in a join's input. In rare cases, this logic had the side effect
    of creating invalid conflict rules for edges, which could prevent valid
    predicates from being added to reordered join trees.
    
    It is safe to remove these conditionals because they are unnecessary.
    The CD-C algorithm already prevents generation of orphaned predicates by
    checking that the total eligibility set (TES) is a subset of a join's
    input vertices. In our implementation, this is handled by the
    `checkNonInnerJoin` and `checkInnerJoin` functions.
    
    Fixes cockroachdb#76522
    
    Release note (bug fix): A bug has been fixed which caused the query optimizer
    to omit join filters in rare cases when reordering joins, which could
    result in incorrect query results. This bug was present since v20.2.
    mgartner committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    824f767 View commit details
    Browse the repository at this point in the history