You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Mostafa Mokhtar (JIRA)" <ji...@apache.org> on 2014/08/09 01:14:12 UTC
[jira] [Created] (HIVE-7666) Join selectivity calculation should
use exponential back-off for conjunction predicates
Mostafa Mokhtar created HIVE-7666:
-------------------------------------
Summary: Join selectivity calculation should use exponential back-off for conjunction predicates
Key: HIVE-7666
URL: https://issues.apache.org/jira/browse/HIVE-7666
Project: Hive
Issue Type: Bug
Components: CBO
Affects Versions: 0.13.1
Reporter: Mostafa Mokhtar
Assignee: Laljo John Pullokkaran
Fix For: 0.14.0
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.
--
This message was sent by Atlassian JIRA
(v6.2#6252)