Avoid redundant cursor construction and seeking in classic engine update and delete path

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None
    • 0

      The query system does repeated work when reading from a collection and updating a document: it creates one cursor to scan (or fetch) the document, and in the UpdateStage, creates a second cursor to update the document. This means two cursors have to be created, and two seeks have to be done.

      We should consider making changes in the db/exec/ engine to avoid this. Currently stages do not share resources in this fashion, and are oblivious to what other stages do, so implementing this in a non-hacky way that preserves the independence of the stages would require some thinking.

      Before considering this, we should do SERVER-105226 and the linked WT ticket to verify that the improvement is actually substantial.

      We should also investigate a similar optimization for deletes.

            Assignee:
            Unassigned
            Reporter:
            Ian Boros
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: