summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/plan_executor_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/plan_executor_impl.cpp')
-rw-r--r--src/mongo/db/query/plan_executor_impl.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mongo/db/query/plan_executor_impl.cpp b/src/mongo/db/query/plan_executor_impl.cpp
index 03de8319f5c..ae40ecd070e 100644
--- a/src/mongo/db/query/plan_executor_impl.cpp
+++ b/src/mongo/db/query/plan_executor_impl.cpp
@@ -33,6 +33,7 @@
#include "mongo/db/query/plan_executor_impl.h"
+#include "mongo/util/duration.h"
#include <memory>
#include "mongo/bson/simple_bsonobj_comparator.h"
@@ -136,13 +137,6 @@ PlanExecutorImpl::PlanExecutorImpl(OperationContext* opCtx,
invariant(!_expCtx || _expCtx->opCtx == _opCtx);
invariant(!_cq || !_expCtx || _cq->getExpCtx() == _expCtx);
- // If this PlanExecutor is executing a COLLSCAN, keep a pointer directly to the COLLSCAN
- // stage. This is used for change streams in order to keep the the latest oplog timestamp
- // and post batch resume token up to date as the oplog scan progresses.
- if (auto collectionScan = getStageByType(_root.get(), STAGE_COLLSCAN)) {
- _collScanStage = static_cast<CollectionScan*>(collectionScan);
- }
-
// If we don't yet have a namespace string, then initialize it from either 'collection' or
// '_cq'.
if (_nss.isEmpty()) {
@@ -174,6 +168,13 @@ PlanExecutorImpl::PlanExecutorImpl(OperationContext* opCtx,
_planExplainer->updateEnumeratorExplainInfo(
subplanStage->compositeSolution()->_enumeratorExplainInfo);
}
+
+ // If this PlanExecutor is executing a COLLSCAN, keep a pointer directly to the COLLSCAN
+ // stage. This is used for change streams in order to keep the the latest oplog timestamp
+ // and post batch resume token up to date as the oplog scan progresses.
+ if (auto collectionScan = getStageByType(_root.get(), STAGE_COLLSCAN)) {
+ _collScanStage = static_cast<CollectionScan*>(collectionScan);
+ }
}
Status PlanExecutorImpl::_pickBestPlan() {