Shant Hovsepian created IMPALA-10320:
----------------------------------------

             Summary: Set selectivity of BooleanLiteral
                 Key: IMPALA-10320
                 URL: https://issues.apache.org/jira/browse/IMPALA-10320
             Project: IMPALA
          Issue Type: Improvement
          Components: Frontend
    Affects Versions: Impala 3.4.0
            Reporter: Shant Hovsepian
            Assignee: Shant Hovsepian


The selectivity for BooleanLiterals is not current set. In most cases 
predicates containing boolean literals are either rare or optimized away. 
However certain statement rewrites will insert boolean literals when modifying 
or removed a predicate that is no longer relevant, with more complex predicates 
and in particular disjunctive predicates these boolean literals can't be 
optimized away.

Simply a true literal should have selectivity of 1 and false of 0.

 

For example the cardinality below should in fact be closer to 7,300 instead of 
assuming the default selectivity of 0.1 hence 730. 
{noformat}

Query: explain select id from alltypes where int_col != 1 or true
+-------------------------------------------------------------+
| Explain String                                              |
+-------------------------------------------------------------+
| Max Per-Host Resource Reservation: Memory=32.00KB Threads=3 |
| Per-Host Resource Estimates: Memory=160MB                   |
| Codegen disabled by planner                                 |
|                                                             |
| PLAN-ROOT SINK                                              |
| |                                                           |
| 01:EXCHANGE [UNPARTITIONED]                                 |
| |                                                           |
| 00:SCAN HDFS [functional.alltypes]                          |
|    HDFS partitions=24/24 files=24 size=478.45KB             |
|    predicates: TRUE OR int_col != 1                         |
|    row-size=8B cardinality=730                              |
+-------------------------------------------------------------+{noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to