Zoltán Borók-Nagy created IMPALA-11797:
------------------------------------------

             Summary: LEFT ANTI JOIN's selectivity is always 1.0
                 Key: IMPALA-11797
                 URL: https://issues.apache.org/jira/browse/IMPALA-11797
             Project: IMPALA
          Issue Type: Bug
          Components: Frontend
            Reporter: Zoltán Borók-Nagy


We use the [following 
formula|https://github.com/apache/impala/blob/b88cfadbbde45ccbe5e4b6d644d046a9a275e31c/fe/src/main/java/org/apache/impala/planner/JoinNode.java#L690]
 to calculate the LEFT ANTI JOIN's selectivity:

{noformat}
selectivity = (double) Math.max(lhsNdv - rhsNdv, lhsNdv) / (double) lhsNdv;
{noformat}

{{Math.max(lhsNdv - rhsNdv, lhsNdv)}} is always equals to {{lhsNdv}}, hence the 
formula becomes:

{noformat}
lhsNdv / lhsNdv
{noformat}

which is always 1.0. We should come up with a better formula.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org
For additional commands, e-mail: issues-all-h...@impala.apache.org

Reply via email to