-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
Refactor ScanStage stage to improve performance.
Suggested changes:
- Split ScanStage into SeekStage, ScanStage and RandomScanStage. Those operations are mutually exclusive. Splitting the stages will reduce the method sizes and reduce the amount branching on the hotpath.
- Remove unnecessary virtual calls from IndexScan stage. If code sharing between Scan stage variants 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.
- 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)
- is related to
-
SERVER-85623 Investigate why SBE ixscan+fetch is ~15% slower equivalent handcrafted index scan
- Closed
- related to
-
SERVER-77968 Refactor ScanStage in SBE
- Backlog