summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/plan_executor_impl.h
diff options
context:
space:
mode:
authorAnton Korshunov <anton.korshunov@mongodb.com>2020-02-20 14:06:18 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-26 08:58:45 +0000
commit6bbb8a83a1df51bf88d18961425501301915fc0a (patch)
treeeaa31e40cfd3a3fccd3ee3c2ccc53a8afc6ef386 /src/mongo/db/query/plan_executor_impl.h
parent51eceb8afa6610b4ff0befb92ec6039173bab00f (diff)
downloadmongo-6bbb8a83a1df51bf88d18961425501301915fc0a.tar.gz
SERVER-46270 Optimize postBatchResumeToken and latestOpLogTimestamp retrieval in PlanExecutor
Diffstat (limited to 'src/mongo/db/query/plan_executor_impl.h')
-rw-r--r--src/mongo/db/query/plan_executor_impl.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/query/plan_executor_impl.h b/src/mongo/db/query/plan_executor_impl.h
index d82a1e33460..cffddab0b3e 100644
--- a/src/mongo/db/query/plan_executor_impl.h
+++ b/src/mongo/db/query/plan_executor_impl.h
@@ -196,6 +196,13 @@ private:
enum { kUsable, kSaved, kDetached, kDisposed } _currentState = kUsable;
bool _everDetachedFromOperationContext = false;
+
+ // A pointer either to a ChangeStreamProxy or a CollectionScan stage, if present in the
+ // execution tree, or nullptr otherwise. We cache it to avoid the need to traverse the execution
+ // tree in runtime when the executor is requested to return the oplog tracking info. Since this
+ // info is provided by either of these stages, the executor will simply delegate the request to
+ // the cached stage.
+ const PlanStage* _oplogTrackingStage{nullptr};
};
} // namespace mongo