You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Vincent Tran (JIRA)" <ji...@apache.org> on 2017/06/13 03:49:00 UTC
[jira] [Created] (IMPALA-5494) NOT IN predicate shares the same
selectivity as IN predicate
Vincent Tran created IMPALA-5494:
------------------------------------
Summary: NOT IN predicate shares the same selectivity as IN predicate
Key: IMPALA-5494
URL: https://issues.apache.org/jira/browse/IMPALA-5494
Project: IMPALA
Issue Type: Bug
Components: Frontend
Affects Versions: Impala 2.8.0
Reporter: Vincent Tran
Priority: Minor
InPredicate logic should either set the selectivity to:
1 - (numChild/NumDistinctValues)
or
default selectivity (e.g. 0.1) as in the equivalent case of multiple inequality predicates (seen below.)
{noformat}
[kiwi-3:21000] > set explain_level=3;
EXPLAIN_LEVEL set to 3
[kiwi-3:21000] > explain select * from customers where id in (1,2);
Query: explain select * from customers where id in (1,2)
+-------------------------------------------------------+
| Explain String |
+-------------------------------------------------------+
| Per-Host Resource Reservation: Memory=0B |
| Per-Host Resource Estimates: Memory=16.00MB |
| |
| F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1 |
| PLAN-ROOT SINK |
| | mem-estimate=0B mem-reservation=0B |
| | |
| 00:SCAN HDFS [default.customers] |
| partitions=1/1 files=1 size=15.44KB |
| predicates: id IN (1, 2) |
| table stats: 53 rows total |
| column stats: all |
| parquet statistics predicates: id IN (1, 2) |
| parquet dictionary predicates: id IN (1, 2) |
| mem-estimate=16.00MB mem-reservation=0B |
| tuple-ids=0 row-size=35B cardinality=2 |
+-------------------------------------------------------+
Fetched 16 row(s) in 0.02s
[kiwi-3:21000] > explain select * from customers where id not in (1,2);
Query: explain select * from customers where id not in (1,2)
+-------------------------------------------------------+
| Explain String |
+-------------------------------------------------------+
| Per-Host Resource Reservation: Memory=0B |
| Per-Host Resource Estimates: Memory=16.00MB |
| |
| F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1 |
| PLAN-ROOT SINK |
| | mem-estimate=0B mem-reservation=0B |
| | |
| 00:SCAN HDFS [default.customers] |
| partitions=1/1 files=1 size=15.44KB |
| predicates: id NOT IN (1, 2) |
| table stats: 53 rows total |
| column stats: all |
| parquet dictionary predicates: id NOT IN (1, 2) |
| mem-estimate=16.00MB mem-reservation=0B |
| tuple-ids=0 row-size=35B cardinality=2 |
+-------------------------------------------------------+
Fetched 15 row(s) in 0.01s
[kiwi-3:21000] > explain select * from customers where id !=1 and id !=2;
Query: explain select * from customers where id !=1 and id !=2
+-------------------------------------------------------+
| Explain String |
+-------------------------------------------------------+
| Per-Host Resource Reservation: Memory=0B |
| Per-Host Resource Estimates: Memory=16.00MB |
| |
| F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1 |
| PLAN-ROOT SINK |
| | mem-estimate=0B mem-reservation=0B |
| | |
| 00:SCAN HDFS [default.customers] |
| partitions=1/1 files=1 size=15.44KB |
| predicates: id != 1, id != 2 |
| table stats: 53 rows total |
| column stats: all |
| parquet dictionary predicates: id != 1, id != 2 |
| mem-estimate=16.00MB mem-reservation=0B |
| tuple-ids=0 row-size=35B cardinality=5 |
+-------------------------------------------------------+
Fetched 15 row(s) in 0.02s
{noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)