trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zellerh <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request: [TRAFODION-1585] Allow MDAM on i...
Date Tue, 17 Nov 2015 02:29:09 GMT
Github user zellerh commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/174#discussion_r45015567
  
    --- Diff: core/sql/optimizer/ScanOptimizer.cpp ---
    @@ -3364,7 +3364,25 @@ ScanOptimizer::isMdamEnabled() const
     
         // If # of probes for NJ is <= cqd(MDAM_UNDER_NJ_PROBES_THRESHOLD),
         // we will use MDAM regardless of the setting of CQD MDAM_SCAN_METHOD.
    -    // When the CQD is 0, MDAM under NJ is not considered.
    +    // When the CQD is 0, MDAM under NJ is not considered unless we
    +    // have a cardinality constraint on the number of probes that 
    +    // guarantees at most one probe.
    +
    +    const InputPhysicalProperty* ippForMe =
    +      getContext().getInputPhysicalProperty();
    +    if (ippForMe)
    +      {
    +        const CardConstraint * outerCardConstraint =
    +          ippForMe->getOuterCardConstraint();
    +        if (outerCardConstraint)
    +          {
    +            Cardinality upperBound = outerCardConstraint->getUpperBound();
    +            if (upperBound <= (Cardinality)1)
    --- End diff --
    
    Sounds good for now, maybe we can extend this to small cardinalities > 1 in the future,
e.g. by using an integer-valued CQD here?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message