You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Zoltán Borók-Nagy (Jira)" <ji...@apache.org> on 2022/12/13 18:20:00 UTC

[jira] [Created] (IMPALA-11797) LEFT ANTI JOIN's selectivity is always 1.0

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)