[ 
https://issues.apache.org/jira/browse/CALCITE-1794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17499035#comment-17499035
 ] 

Julian Hyde commented on CALCITE-1794:
--------------------------------------

It works for me.

{noformat}
sqlline> !connect 
jdbc:calcite:model=file/src/test/resources/model.json;fun=postgresql admin admin
> explain plan for select * from emps where deptno <> 20 and deptno = 25;
+--------------------------------------------------------------------------------------------------------------------+
|                                                        PLAN                   
                                     |
+--------------------------------------------------------------------------------------------------------------------+
| EnumerableCalc(expr#0..9=[{inputs}], expr#10=[25], expr#11=[=($t2, $t10)], 
proj#0..9=[{exprs}], $condition=[$t11])
  CsvTableScan(table=[[SALES, |
+--------------------------------------------------------------------------------------------------------------------+
1 row selected (0.022 seconds)
{noformat}

I guess you've disabled SARGs? Well, don't.

> Simplify AND numeric comparisons when overlapping
> -------------------------------------------------
>
>                 Key: CALCITE-1794
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1794
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.29.0
>            Reporter: Remus Rusanu
>            Assignee: xiong duan
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Expressions such as {{$1<>1 and $1=2}} can be simplified to {{$1=2}}. Similar 
> {{$1>10 AND $1>20}} can be simplified to {{$1>20}}. Such expressions are 
> produced by the proposed solution for CALCITE-1790 (simplify boolean CASE to 
> complex AND/OR).



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to