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

Remove predicates from Filter if they can be proved to be always true or false

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.15.0
    • Component/s: None
    • Labels:
      None

      Description

      Remove predicates from Filter if they can be proved to be always true or false. For example, the query

      select *
      from (select * from emp where deptno > 10)
      where  empno > 3 and deptno > 5
      

      can be simplified to

      select *
      from (select * from emp where deptno > 10)
      where  empno > 3
      

      because deptno > 5 can be proved to be always true, due the predicate deptno > 10 on its input relational expression.

      Implement this by expanding the capabilities of FilterReduceExpressionsRule.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                julianhyde Julian Hyde
                Reporter:
                julianhyde Julian Hyde
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: