You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2017/09/30 23:28:00 UTC

[jira] [Created] (CALCITE-1995) Remove predicates from Filter if they can be proved to be always true or false

Julian Hyde created CALCITE-1995:
------------------------------------

             Summary: Remove predicates from Filter if they can be proved to be always true or false
                 Key: CALCITE-1995
                 URL: https://issues.apache.org/jira/browse/CALCITE-1995
             Project: Calcite
          Issue Type: Bug
            Reporter: Julian Hyde
            Assignee: Julian Hyde


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

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

can be simplified to

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

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}}.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)