Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-5675

Infer predicates for anti-join

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.35.0
    • core

    Description

      Enhance RelMdPredicates to be able to infer predicates for anti-joins.

      Consider the following plans with an anti join between EMP and DEPT tables.
      PulledUpPredicates

      LogicalJoin(condition=[=($7, $8)], joinType=[anti])
        LogicalFilter(condition=[=($1, 'Victor')])
          LogicalTableScan(table=[[scott, EMP]])
        LogicalFilter(condition=[=($1, 'CSD')])
          LogicalTableScan(table=[[scott, DEPT]])
      

      We can infer that the >($1, 'Victor') predicate holds on the result of the join.

      RightInferredPredicates

      LogicalJoin(condition=[=($7, $8)], joinType=[anti])
        LogicalFilter(condition=[>($7, 10)])
          LogicalTableScan(table=[[scott, EMP]])
        LogicalTableScan(table=[[scott, DEPT]])
      

      We can infer that the >($0, 10) predicate holds on the right relation (DEPT).

      Attachments

        Issue Links

          Activity

            People

              zabetak Stamatis Zampetakis
              zabetak Stamatis Zampetakis
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: