trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaveBirdsall <>
Subject [GitHub] incubator-trafodion pull request: [TRAFODION-1585] Allow MDAM on i...
Date Tue, 17 Nov 2015 16:20:57 GMT
Github user DaveBirdsall commented on a diff in the pull request:
    --- 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 --
    There is already a CQD just a few lines down in the code that will allow this for estimates.
I wanted to avoid introducing yet another CQD. That was the point of the code a few lines
down that used the cardinality constraint to sharpen the row estimate.

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

View raw message