diff options
author | Hari Khalsa <hkhalsa@10gen.com> | 2014-03-24 20:16:59 -0400 |
---|---|---|
committer | Hari Khalsa <hkhalsa@10gen.com> | 2014-03-25 11:10:47 -0400 |
commit | 1f762a3478bb2f794e72670d333f35c6b7e6cfa7 (patch) | |
tree | 9248c9e417b1edbc9616fece58bbd5019caef91b | |
parent | 5138b611cbb384f87c0437d51f1fe3a72a4bf7b4 (diff) | |
download | mongo-1f762a3478bb2f794e72670d333f35c6b7e6cfa7.tar.gz |
SERVER-13336 count should always yield
Revert "SERVER-12554 Lazily yield on count queries."
This reverts commit 2850cc7253344c639bc9a01bc6dff3ffd2cca422.
-rw-r--r-- | src/mongo/db/ops/count.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/mongo/db/ops/count.cpp b/src/mongo/db/ops/count.cpp index 774151b0f65..e4ffb974625 100644 --- a/src/mongo/db/ops/count.cpp +++ b/src/mongo/db/ops/count.cpp @@ -35,7 +35,6 @@ #include "mongo/db/catalog/database.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/query/get_runner.h" -#include "mongo/util/elapsed_tracker.h" namespace mongo { @@ -95,20 +94,13 @@ namespace mongo { uassertStatusOK(getRunnerCount(collection, query, hintObj, &rawRunner)); auto_ptr<Runner> runner(rawRunner); - ElapsedTracker timeToStartYielding(128, 10); try { const ScopedRunnerRegistration safety(runner.get()); + runner->setYieldPolicy(Runner::YIELD_AUTO); long long count = 0; Runner::RunnerState state; while (Runner::RUNNER_ADVANCED == (state = runner->getNext(NULL, NULL))) { - - // Lazily yield, avoiding a performance regression when - // scanning a very small number of documents. - if (timeToStartYielding.intervalHasElapsed()) { - runner->setYieldPolicy(Runner::YIELD_AUTO); - } - if (skip > 0) { --skip; } |