diff options
Diffstat (limited to 'src/mongo/db/query/plan_ranker.h')
-rw-r--r-- | src/mongo/db/query/plan_ranker.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mongo/db/query/plan_ranker.h b/src/mongo/db/query/plan_ranker.h index 1f0f1779b19..973429c0609 100644 --- a/src/mongo/db/query/plan_ranker.h +++ b/src/mongo/db/query/plan_ranker.h @@ -86,6 +86,9 @@ namespace mongo { * and used by the CachedPlanRunner to compare expected performance with actual. */ struct PlanRankingDecision { + + PlanRankingDecision() : tieForBest(false) { } + /** * Make a deep copy. */ @@ -98,6 +101,7 @@ namespace mongo { } decision->scores = scores; decision->candidateOrder = candidateOrder; + decision->tieForBest = tieForBest; return decision; } @@ -116,6 +120,13 @@ namespace mongo { // candidates[candidateOrder[1]] followed by // candidates[candidateOrder[2]], ... std::vector<size_t> candidateOrder; + + // Did two plans tie for best? + // + // NOTE: Reading this is the only reliable way to determine if there was a tie, + // because the scores kept inside the PlanRankingDecision do not incorporate + // the EOF bonus. + bool tieForBest; }; } // namespace mongo |