mirror of
https://github.com/apache/impala.git
synced 2026-02-02 15:00:38 -05:00
The original selectivity of 1.0 - 1.0/ndv makes sense for large NDVs, but the result is 0.0 in case of ndv==1, which leads to a cardinality of 1 even for huge tables. The new selectivity is 0.5. Note that as the formula for = is not changed (1.0/ndv), NOT col="const" will still lead to 0.0 selectivity if ndv=1. Changing the formula of NOT or = would have caused a lot of subtle changes in plans in tests, so I don't want to touch those before coming to wider agreement about the correct approach. IMPALA-7601 contains some discussion about these formulas. Testing: - added a regression test Change-Id: I6b5334a8d7d6ca46a450ff98ae03e5269faaa3c6 Reviewed-on: http://gerrit.cloudera.org:8080/18543 Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>