summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/plan_ranker.cpp
diff options
context:
space:
mode:
authorJacob Evans <jacob.evans@10gen.com>2019-01-04 13:15:58 -0500
committerJacob Evans <jacob.evans@10gen.com>2019-01-29 13:53:10 -0500
commit41557fac170a905cb7b0cca7564e4c0ec48bbefd (patch)
tree5dc37a78b02e03ceefa34f75abc13b5062e17a0e /src/mongo/db/query/plan_ranker.cpp
parentb4ee2a119c65d1f2a0cb2288c1242fbf4f74a543 (diff)
downloadmongo-41557fac170a905cb7b0cca7564e4c0ec48bbefd.tar.gz
SERVER-38695 Make QuerySolutionNode subclasses for projection fast-paths
Diffstat (limited to 'src/mongo/db/query/plan_ranker.cpp')
-rw-r--r--src/mongo/db/query/plan_ranker.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/query/plan_ranker.cpp b/src/mongo/db/query/plan_ranker.cpp
index a8260b22c7f..897e664e7f1 100644
--- a/src/mongo/db/query/plan_ranker.cpp
+++ b/src/mongo/db/query/plan_ranker.cpp
@@ -214,7 +214,9 @@ double PlanRanker::scoreTree(const PlanStageStats* stats) {
// We only do this when we have a projection stage because we have so many jstests that
// check bounds even when a collscan plan is just as good as the ixscan'd plan :(
double noFetchBonus = epsilon;
- if (hasStage(STAGE_PROJECTION, stats) && hasStage(STAGE_FETCH, stats)) {
+ if ((hasStage(STAGE_PROJECTION_DEFAULT, stats) || hasStage(STAGE_PROJECTION_COVERED, stats) ||
+ hasStage(STAGE_PROJECTION_SIMPLE, stats)) &&
+ hasStage(STAGE_FETCH, stats)) {
noFetchBonus = 0;
}