Github user zellerh commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/199#discussion_r46347665
  
    --- Diff: core/sql/optimizer/ScanOptimizer.cpp ---
    @@ -387,28 +390,61 @@ static NABoolean checkMDAMadditionalRestriction(
                )
                noOfmissingKeyColumns++;
     
    -        // accumulate the product of uecs for columns without predicates
    -                   
    -        totalUecsForKeylessKeyColumns *= hist.getColStatsForColumn(
    -                   
keyPredsByCol.getKeyColumnId(index)).getTotalUec().getCeiling();
    +        // accumulate the product of uecs for columns without predicates 
in the current
    +        // group
    +        totalUecsForCurrentPredicatelessKeyColumnGroup *= 
hist.getColStatsForColumn(
    +                   columnVid).getTotalUec().getCeiling();
     
    +        // accumulate the column valud Id at the same time for MC UEC 
lookup later on.
    +        currentPredicatelessKeyColumnGroup.insert(columnVid);
          } else {
     
             checkLeadingDivColumns = FALSE;
             presentKeyColumns++;
     
    +        // If the set of key columns without predicate is not empty, fetch 
the MC UEC 
    +        // for the entire set. If the MC UEC exists, replace the current 
accumualted
    +        // total UEC with the MC UEC.
    +        //
    +        // We will set the set to empty so that the fetching MC UEC logic 
will not kick in 
    +        // until a new key column without predicates is seen.
    +        if ( currentPredicatelessKeyColumnGroup.entries() > 0 ) {
    --- End diff --
    
    I guess we could use > 1 here, to skip single columns?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to