Description
Assuming dependency for predicate (number of column joins & filters) will almost always hurt us as implied correlations do actually exist.
Currently HiveRelMdSelectivity.computeInnerJoinSelectivity uses to log to smoothen selectivity of conjunction predicates which results in un-optimal plans.
The problem with log is that it still assumes dependency, For instance in TPC-DS Q17 store_sales has 6 join predicates which explains why stor_sales is in the wrong place in the plan.
Change the algorithm to use exponential back-off :
ndv(pe0) * ndv(pe1) ^(1/2) * ndv(pe2) ^(1/4) * ndv(pe3) ^(1/8)
Opposed to :
ndv(pex)*log(ndv(pe1))*log(ndv(pe2))
For TPC-DS Q17 store_sales has 6 inner join predicates if we assume selectivity of 0.7 for each join then join selectivity can end up being 6.24285E-05 which is too low and eventually results in an un-optimal plan.
Attachments
Issue Links
- relates to
-
HIVE-7836 Ease-out denominator for multi-attribute join case in statistics annotation
- Closed