Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-7666

Join selectivity calculation should use exponential back-off for conjunction predicates

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.13.1
    • 0.14.0
    • CBO

    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

          Activity

            People

              jpullokkaran Laljo John Pullokkaran
              mmokhtar Mostafa Mokhtar
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: