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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.15.0
    • None
    • 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

              julianhyde Julian Hyde
              julianhyde Julian Hyde
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: