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

Refactor IndexScan stage to improve performance

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Query Execution

      Refactor IndexScan stage to improve performance.

      Suggested changes:

      • Remove unnecessary virtual calls from IndexScan stage. If code sahring between Simple and Generic index scan is desired a templates can be used for methods that would need to otherwise call virtual methods.
      • Refactor code and branching so that open and getNext have minimal size. All expensive/optional operatations can be extracted to separate methods to discourage inlining of code that is often skipped.
      • Encourage inlining of small methods on the hot path.
      • Move loop invariants out of the loop. e.g. Some slot assignment is invariant and can be done in open/prepare phase, and no longer needs assignment in getNext.
      • Reduce frequency of calling into YieldPolicy, at minimum we should be able to gate the yield checks behind the counter even if yield policy is present.


       A POC here https://github.com/10gen/mongo/compare/anna.wawrzyniak/SERVER-85623?expand=1 demonstrates the above changes and possible performance improvement (see SERVER-85623)

            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            anna.wawrzyniak@mongodb.com Anna Wawrzyniak
            0 Vote for this issue
            7 Start watching this issue