diff options
-rw-r--r-- | src/mongo/db/exec/and_hash.cpp | 15 | ||||
-rw-r--r-- | src/mongo/db/exec/and_sorted.cpp | 12 | ||||
-rw-r--r-- | src/mongo/db/exec/keep_mutations.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/exec/limit.cpp | 6 | ||||
-rw-r--r-- | src/mongo/db/exec/merge_sort.cpp | 6 | ||||
-rw-r--r-- | src/mongo/db/exec/multi_plan.cpp | 11 | ||||
-rw-r--r-- | src/mongo/db/exec/or.cpp | 6 | ||||
-rw-r--r-- | src/mongo/db/exec/plan_stage.h | 18 | ||||
-rw-r--r-- | src/mongo/db/exec/plan_stats.h | 4 | ||||
-rw-r--r-- | src/mongo/db/exec/projection.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/exec/shard_filter.cpp | 5 | ||||
-rw-r--r-- | src/mongo/db/exec/skip.cpp | 6 | ||||
-rw-r--r-- | src/mongo/db/exec/sort.cpp | 6 | ||||
-rw-r--r-- | src/mongo/db/exec/text.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/query/explain_plan.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/query/plan_executor.cpp | 11 | ||||
-rw-r--r-- | src/mongo/db/query/plan_ranker.cpp | 8 | ||||
-rw-r--r-- | src/mongo/dbtests/query_stage_limit_skip.cpp | 1 |
18 files changed, 14 insertions, 112 deletions
diff --git a/src/mongo/db/exec/and_hash.cpp b/src/mongo/db/exec/and_hash.cpp index 418bc000928..2185b12e3c5 100644 --- a/src/mongo/db/exec/and_hash.cpp +++ b/src/mongo/db/exec/and_hash.cpp @@ -155,8 +155,7 @@ namespace mongo { _dataMap.clear(); return PlanStage::FAILURE; } - // We ignore NEED_TIME. TODO: What do we want to do if the child provides - // NEED_FETCH? + // We ignore NEED_TIME. } } @@ -318,11 +317,7 @@ namespace mongo { return childStatus; } else { - if (PlanStage::NEED_FETCH == childStatus) { - *out = id; - ++_commonStats.needFetch; - } - else if (PlanStage::NEED_TIME == childStatus) { + if (PlanStage::NEED_TIME == childStatus) { ++_commonStats.needTime; } @@ -421,11 +416,7 @@ namespace mongo { return childStatus; } else { - if (PlanStage::NEED_FETCH == childStatus) { - *out = id; - ++_commonStats.needFetch; - } - else if (PlanStage::NEED_TIME == childStatus) { + if (PlanStage::NEED_TIME == childStatus) { ++_commonStats.needTime; } diff --git a/src/mongo/db/exec/and_sorted.cpp b/src/mongo/db/exec/and_sorted.cpp index cc63e03a023..9ba1bc52584 100644 --- a/src/mongo/db/exec/and_sorted.cpp +++ b/src/mongo/db/exec/and_sorted.cpp @@ -128,11 +128,7 @@ namespace mongo { return state; } else { - if (PlanStage::NEED_FETCH == state) { - *out = id; - ++_commonStats.needFetch; - } - else if (PlanStage::NEED_TIME == state) { + if (PlanStage::NEED_TIME == state) { ++_commonStats.needTime; } @@ -247,11 +243,7 @@ namespace mongo { return state; } else { - if (PlanStage::NEED_FETCH == state) { - *out = id; - ++_commonStats.needFetch; - } - else if (PlanStage::NEED_TIME == state) { + if (PlanStage::NEED_TIME == state) { ++_commonStats.needTime; } return state; diff --git a/src/mongo/db/exec/keep_mutations.cpp b/src/mongo/db/exec/keep_mutations.cpp index be8e97addb9..da6852d8ca2 100644 --- a/src/mongo/db/exec/keep_mutations.cpp +++ b/src/mongo/db/exec/keep_mutations.cpp @@ -64,9 +64,6 @@ namespace mongo { else if (PlanStage::NEED_TIME == status) { ++_commonStats.needTime; } - else if (PlanStage::NEED_FETCH == status) { - ++_commonStats.needFetch; - } return status; } diff --git a/src/mongo/db/exec/limit.cpp b/src/mongo/db/exec/limit.cpp index e084781dbaf..94cc040edc7 100644 --- a/src/mongo/db/exec/limit.cpp +++ b/src/mongo/db/exec/limit.cpp @@ -70,11 +70,7 @@ namespace mongo { return status; } else { - if (PlanStage::NEED_FETCH == status) { - *out = id; - ++_commonStats.needFetch; - } - else if (PlanStage::NEED_TIME == status) { + if (PlanStage::NEED_TIME == status) { ++_commonStats.needTime; } return status; diff --git a/src/mongo/db/exec/merge_sort.cpp b/src/mongo/db/exec/merge_sort.cpp index df72dd5016e..527d4d508b8 100644 --- a/src/mongo/db/exec/merge_sort.cpp +++ b/src/mongo/db/exec/merge_sort.cpp @@ -140,11 +140,7 @@ namespace mongo { return code; } else { - if (PlanStage::NEED_FETCH == code) { - *out = id; - ++_commonStats.needFetch; - } - else if (PlanStage::NEED_TIME == code) { + if (PlanStage::NEED_TIME == code) { ++_commonStats.needTime; } return code; diff --git a/src/mongo/db/exec/multi_plan.cpp b/src/mongo/db/exec/multi_plan.cpp index 97d6ad42cdc..57d2b354312 100644 --- a/src/mongo/db/exec/multi_plan.cpp +++ b/src/mongo/db/exec/multi_plan.cpp @@ -272,17 +272,6 @@ namespace mongo { doneWorking = true; } } - else if (PlanStage::NEED_FETCH == state) { - // id has a loc and refers to an obj we need to fetch. - WorkingSetMember* member = candidate.ws->get(id); - - // This must be true for somebody to request a fetch and can only change when an - // invalidation happens, which is when we give up a lock. Don't give up the - // lock between receiving the NEED_FETCH and actually fetching(?). - verify(member->hasLoc()); - - // XXX: remove NEED_FETCH - } else if (PlanStage::IS_EOF == state) { // First plan to hit EOF wins automatically. Stop evaluating other plans. // Assumes that the ranking will pick this plan. diff --git a/src/mongo/db/exec/or.cpp b/src/mongo/db/exec/or.cpp index 83a441d3896..c56e00f6731 100644 --- a/src/mongo/db/exec/or.cpp +++ b/src/mongo/db/exec/or.cpp @@ -122,11 +122,7 @@ namespace mongo { return childStatus; } else { - if (PlanStage::NEED_FETCH == childStatus) { - *out = id; - ++_commonStats.needFetch; - } - else if (PlanStage::NEED_TIME == childStatus) { + if (PlanStage::NEED_TIME == childStatus) { ++_commonStats.needTime; } diff --git a/src/mongo/db/exec/plan_stage.h b/src/mongo/db/exec/plan_stage.h index b1f85499d2b..a4f53d8ca9e 100644 --- a/src/mongo/db/exec/plan_stage.h +++ b/src/mongo/db/exec/plan_stage.h @@ -88,9 +88,6 @@ namespace mongo { * case PlanStage::FAILURE: * // Throw exception or return error * break; - * case PlanStage::NEED_FETCH: - * // Go to disk and fetch stuff. - * break; * } * * if (shouldYield) { @@ -131,18 +128,6 @@ namespace mongo { // Any class implementing this interface must set the WSID out parameter to // INVALID_ID or a valid WSM ID if FAILURE is returned. FAILURE, - - // Something isn't in memory. Fetch it. - // - // Full fetch semantics: - // The fetch-requesting stage populates the out parameter of work(...) with a WSID that - // refers to a WSM with a valid loc. Each stage that receives a NEED_FETCH from a child - // must propagate the NEED_FETCH up and perform no work. The plan runner is responsible - // for paging in the data upon receipt of a NEED_FETCH. The plan runner does NOT free - // the WSID of the requested fetch. The stage that requested the fetch holds the WSID - // of the loc it wants fetched. On the next call to work() that stage can assume a - // fetch was performed on the WSM that the held WSID refers to. - NEED_FETCH, }; static std::string stateStr(const StageState& state) { @@ -155,9 +140,6 @@ namespace mongo { else if (NEED_TIME == state) { return "NEED_TIME"; } - else if (NEED_FETCH == state) { - return "NEED_FETCH"; - } else { verify(FAILURE == state); return "FAILURE"; diff --git a/src/mongo/db/exec/plan_stats.h b/src/mongo/db/exec/plan_stats.h index a3f91c8ebd4..fa326b536d2 100644 --- a/src/mongo/db/exec/plan_stats.h +++ b/src/mongo/db/exec/plan_stats.h @@ -61,7 +61,6 @@ namespace mongo { invalidates(0), advanced(0), needTime(0), - needFetch(0), isEOF(false) { } // Count calls into the stage. @@ -73,7 +72,6 @@ namespace mongo { // How many times was this state the return value of work(...)? size_t advanced; size_t needTime; - size_t needFetch; // TODO: have some way of tracking WSM sizes (or really any series of #s). We can measure // the size of our inputs and the size of our outputs. We can do a lot with the WS here. @@ -81,8 +79,6 @@ namespace mongo { // TODO: once we've picked a plan, collect different (or additional) stats for display to // the user, eg. time_t totalTimeSpent; - // TODO: keep track of total yield time / fetch time for a plan (done by runner) - bool isEOF; }; diff --git a/src/mongo/db/exec/projection.cpp b/src/mongo/db/exec/projection.cpp index b6860d28b31..4251ada524b 100644 --- a/src/mongo/db/exec/projection.cpp +++ b/src/mongo/db/exec/projection.cpp @@ -224,10 +224,6 @@ namespace mongo { *out = WorkingSetCommon::allocateStatusMember( _ws, status); } } - else if (PlanStage::NEED_FETCH == status) { - *out = id; - ++_commonStats.needFetch; - } return status; } diff --git a/src/mongo/db/exec/shard_filter.cpp b/src/mongo/db/exec/shard_filter.cpp index b2c817511ac..72b4bb6887b 100644 --- a/src/mongo/db/exec/shard_filter.cpp +++ b/src/mongo/db/exec/shard_filter.cpp @@ -71,10 +71,7 @@ namespace mongo { return status; } else { - if (PlanStage::NEED_FETCH == status) { - ++_commonStats.needFetch; - } - else if (PlanStage::NEED_TIME == status) { + if (PlanStage::NEED_TIME == status) { ++_commonStats.needTime; } return status; diff --git a/src/mongo/db/exec/skip.cpp b/src/mongo/db/exec/skip.cpp index 04eaf4ae140..eb6ff6f3d1f 100644 --- a/src/mongo/db/exec/skip.cpp +++ b/src/mongo/db/exec/skip.cpp @@ -73,11 +73,7 @@ namespace mongo { return status; } else { - if (PlanStage::NEED_FETCH == status) { - *out = id; - ++_commonStats.needFetch; - } - else if (PlanStage::NEED_TIME == status) { + if (PlanStage::NEED_TIME == status) { ++_commonStats.needTime; } // NEED_TIME/YIELD, ERROR, IS_EOF diff --git a/src/mongo/db/exec/sort.cpp b/src/mongo/db/exec/sort.cpp index 1c88955bc40..ff2e6f94e1d 100644 --- a/src/mongo/db/exec/sort.cpp +++ b/src/mongo/db/exec/sort.cpp @@ -384,11 +384,7 @@ namespace mongo { return code; } else { - if (PlanStage::NEED_FETCH == code) { - *out = id; - ++_commonStats.needFetch; - } - else if (PlanStage::NEED_TIME == code) { + if (PlanStage::NEED_TIME == code) { ++_commonStats.needTime; } return code; diff --git a/src/mongo/db/exec/text.cpp b/src/mongo/db/exec/text.cpp index 4bf3c7ca4bb..190ec4c19e6 100644 --- a/src/mongo/db/exec/text.cpp +++ b/src/mongo/db/exec/text.cpp @@ -88,9 +88,6 @@ namespace mongo { case PlanStage::NEED_TIME: ++_commonStats.needTime; break; - case PlanStage::NEED_FETCH: - ++_commonStats.needFetch; - break; default: break; } diff --git a/src/mongo/db/query/explain_plan.cpp b/src/mongo/db/query/explain_plan.cpp index d93c02123df..ebd8d116552 100644 --- a/src/mongo/db/query/explain_plan.cpp +++ b/src/mongo/db/query/explain_plan.cpp @@ -466,7 +466,6 @@ namespace mongo { bob->appendNumber("invalidates", stats.common.invalidates); bob->appendNumber("advanced", stats.common.advanced); bob->appendNumber("needTime", stats.common.needTime); - bob->appendNumber("needFetch", stats.common.needFetch); bob->appendNumber("isEOF", stats.common.isEOF); // Stage-specific stats diff --git a/src/mongo/db/query/plan_executor.cpp b/src/mongo/db/query/plan_executor.cpp index 76ff61e62f2..f35017e4c54 100644 --- a/src/mongo/db/query/plan_executor.cpp +++ b/src/mongo/db/query/plan_executor.cpp @@ -119,17 +119,6 @@ namespace mongo { else if (PlanStage::NEED_TIME == code) { // Fall through to yield check at end of large conditional. } - else if (PlanStage::NEED_FETCH == code) { - // id has a loc and refers to an obj we need to fetch. - WorkingSetMember* member = _workingSet->get(id); - - // This must be true for somebody to request a fetch and can only change when an - // invalidation happens, which is when we give up a lock. Don't give up the - // lock between receiving the NEED_FETCH and actually fetching(?). - verify(member->hasLoc()); - - // XXX: remove NEED_FETCH - } else if (PlanStage::IS_EOF == code) { return Runner::RUNNER_EOF; } diff --git a/src/mongo/db/query/plan_ranker.cpp b/src/mongo/db/query/plan_ranker.cpp index 01dc6d3cd90..e965562bc0b 100644 --- a/src/mongo/db/query/plan_ranker.cpp +++ b/src/mongo/db/query/plan_ranker.cpp @@ -192,8 +192,8 @@ namespace mongo { double baseScore = 1; // How many "units of work" did the plan perform. Each call to work(...) - // counts as one unit, and each NEED_FETCH is penalized as an additional work unit. - size_t workUnits = stats->common.works + stats->common.needFetch; + // counts as one unit. + size_t workUnits = stats->common.works; // How much did a plan produce? // Range: [0, 1] @@ -242,9 +242,7 @@ namespace mongo { << " + productivity((" << stats->common.advanced << " advanced)/(" << stats->common.works - << " works + " - << stats->common.needFetch - << " needFetch) = " + << " works) = " << productivity << ")" << " + tieBreakers(" << noFetchBonus << " noFetchBonus + " diff --git a/src/mongo/dbtests/query_stage_limit_skip.cpp b/src/mongo/dbtests/query_stage_limit_skip.cpp index 6b9aee95bca..af10638cede 100644 --- a/src/mongo/dbtests/query_stage_limit_skip.cpp +++ b/src/mongo/dbtests/query_stage_limit_skip.cpp @@ -57,7 +57,6 @@ namespace { wsm.obj = BSON("x" << i); ms->pushBack(wsm); ms->pushBack(PlanStage::NEED_TIME); - ms->pushBack(PlanStage::NEED_FETCH); } return ms.release(); |