if (cheapest == null || (cheapest.getCumulativeCosts().compareTo(candidate.getCumulativeCosts()) > 0)) { cheapest = candidate; if (cheapestForGlobal[i] == null || (cheapestForGlobal[i].getCumulativeCosts().compareTo(candidate.getCumulativeCosts()) > 0)) { cheapestForGlobal[i] = candidate; if (lps[k].isMetBy(candidate.getLocalProperties())) { final PlanNode previous = localMatches[k]; if (previous == null || previous.getCumulativeCosts().compareTo(candidate.getCumulativeCosts()) > 0) {
assertTrue(hashBoth.compareTo(bcKnown10) < 0); assertTrue(hashBoth.compareTo(bcUnknown10) < 0); assertTrue(hashBoth.compareTo(bcKnown1000) < 0); assertTrue(hashBoth.compareTo(bcUnknown1000) < 0); assertTrue(bcKnown10.compareTo(bcUnknown10) == 0); assertTrue(bcKnown1000.compareTo(bcUnknown1000) == 0); assertTrue(bcKnown10.compareTo(bcKnown1000) < 0); assertTrue(bcUnknown10.compareTo(bcUnknown1000) < 0);
costEstimator.addHybridHashCosts(BIG_ESTIMATES, BIG_ESTIMATES, hashBothLarge, 1); assertTrue(hashBothSmall.compareTo(hashSmallBuild) < 0); assertTrue(hashSmallBuild.compareTo(hashLargeBuild) < 0); assertTrue(hashLargeBuild.compareTo(hashBothLarge) < 0); assertTrue(mergeBothSmall.compareTo(mergeSmallFirst) < 0); assertTrue(mergeBothSmall.compareTo(mergeSmallSecond) < 0); assertTrue(mergeSmallFirst.compareTo(mergeSmallSecond) == 0); assertTrue(mergeSmallFirst.compareTo(mergeBothLarge) < 0); assertTrue(mergeSmallSecond.compareTo(mergeBothLarge) < 0); assertTrue(hashBothSmall.compareTo(mergeBothSmall) < 0); assertTrue(hashBothLarge.compareTo(mergeBothLarge) < 0); assertTrue(hashSmallBuild.compareTo(mergeSmallFirst) < 0); assertTrue(hashSmallBuild.compareTo(mergeSmallSecond) < 0); assertTrue(hashLargeBuild.compareTo(mergeSmallFirst) < 0); assertTrue(hashLargeBuild.compareTo(mergeSmallSecond) < 0);
assertTrue(hashBothSmall.compareTo(hashSmallAndLarge) < 0); assertTrue(hashSmallAndLarge.compareTo(hashBothLarge) < 0); assertTrue(hashLargeBcSmall10.compareTo(hashSmallBcLarge10) < 0); assertTrue(forwardLargeBcSmall10.compareTo(forwardSmallBcLarge10) < 0); assertTrue(hashLargeBcSmall1000.compareTo(hashSmallBcLarge1000) < 0); assertTrue(forwardLargeBcSmall1000.compareTo(forwardSmallBcLarge1000) < 0); assertTrue(forwardLargeBcSmall10.compareTo(hashSmallAndLarge) < 0); assertTrue(forwardLargeBcSmall1000.compareTo(hashSmallAndLarge) > 0); assertTrue(hashSmallBcLarge10.compareTo(hashSmallBcLarge1000) < 0); assertTrue(hashLargeBcSmall10.compareTo(hashLargeBcSmall1000) < 0); assertTrue(forwardSmallBcLarge10.compareTo(forwardSmallBcLarge1000) < 0); assertTrue(forwardLargeBcSmall10.compareTo(forwardLargeBcSmall1000) < 0); assertTrue(forwardSmallBcLarge10.compareTo(hashSmallBcLarge10) < 0); assertTrue(forwardSmallBcLarge1000.compareTo(hashSmallBcLarge1000) < 0); assertTrue(forwardLargeBcSmall10.compareTo(hashLargeBcSmall10) < 0); assertTrue(forwardLargeBcSmall1000.compareTo(hashLargeBcSmall1000) < 0);
assertTrue(hashBothUnknown10.compareTo(hashBothUnknownCached10) > 0); assertTrue(hashBothSmall10.compareTo(hashBothSmallCached10) > 0); assertTrue(hashSmallLarge10.compareTo(hashSmallLargeCached10) > 0); assertTrue(hashLargeSmall10.compareTo(hashLargeSmallCached10) > 0); assertTrue(hashLargeSmallCached10.compareTo(hashSmallLargeCached10) < 0); assertTrue(hashLargeSmall1.compareTo(hashLargeSmallCached1) == 0);
if (cheapest == null || (cheapest.getCumulativeCosts().compareTo(candidate.getCumulativeCosts()) > 0)) { cheapest = candidate; if (cheapestForGlobal[i] == null || (cheapestForGlobal[i].getCumulativeCosts().compareTo(candidate.getCumulativeCosts()) > 0)) { cheapestForGlobal[i] = candidate; if (lps[k].isMetBy(candidate.getLocalProperties())) { final PlanNode previous = localMatches[k]; if (previous == null || previous.getCumulativeCosts().compareTo(candidate.getCumulativeCosts()) > 0) {
if (cheapest == null || (cheapest.getCumulativeCosts().compareTo(candidate.getCumulativeCosts()) > 0)) { cheapest = candidate; if (cheapestForGlobal[i] == null || (cheapestForGlobal[i].getCumulativeCosts().compareTo(candidate.getCumulativeCosts()) > 0)) { cheapestForGlobal[i] = candidate; if (lps[k].isMetBy(candidate.getLocalProperties())) { final PlanNode previous = localMatches[k]; if (previous == null || previous.getCumulativeCosts().compareTo(candidate.getCumulativeCosts()) > 0) {
if (cheapest == null || (cheapest.getCumulativeCosts().compareTo(candidate.getCumulativeCosts()) > 0)) { cheapest = candidate; if (cheapestForGlobal[i] == null || (cheapestForGlobal[i].getCumulativeCosts().compareTo(candidate.getCumulativeCosts()) > 0)) { cheapestForGlobal[i] = candidate; if (lps[k].isMetBy(candidate.getLocalProperties())) { final PlanNode previous = localMatches[k]; if (previous == null || previous.getCumulativeCosts().compareTo(candidate.getCumulativeCosts()) > 0) {
if (cheapest == null || (cheapest.getCumulativeCosts().compareTo(candidate.getCumulativeCosts()) > 0)) { cheapest = candidate; if (cheapestForGlobal[i] == null || (cheapestForGlobal[i].getCumulativeCosts().compareTo(candidate.getCumulativeCosts()) > 0)) { cheapestForGlobal[i] = candidate; if (lps[k].isMetBy(candidate.getLocalProperties())) { final PlanNode previous = localMatches[k]; if (previous == null || previous.getCumulativeCosts().compareTo(candidate.getCumulativeCosts()) > 0) {