Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-46270

Optimize postBatchResumeToken and latestOpLogTimestamp retrieval in PlanExecutor

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.3.4
    • None
    • Querying
    • Fully Compatible
    • Query 2020-02-24, Query 2020-03-09

    Description

      Currently, the find or getMore commands tries to retrieve a postBatchResumeToken for each document in a batch, unconditionally calling PlanExecutor::getPostBatchResumeToken() even though the execution tree doesn't contain a stage which can produce the token.

      Moreover, the implementation of the PlanExecutor::getPostBatchResumeToken() method is sub-optimal, as we traverse the entire execution tree trying twice to find either ChangeStreamProxyStage or CollectionScan.

      Similarly is PlanExecutor::getLatestOplogTimestamp().

      We can optimize these methods to avoid the need to traverse the execution tree over and over again, and only call these methods when we know upfront that the execution can produce a postBatchResumeToken or latestOpLogTimestamp.

      Attachments

        Activity

          People

            anton.korshunov@mongodb.com Anton Korshunov
            anton.korshunov@mongodb.com Anton Korshunov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: