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

Template SortExecutor to be able to sort either WorkingSetMember or Document, improving agg sort perf

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.1
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Fully Compatible
    • Query 2019-11-04, Query 2019-11-18
    • 0

      Performance tests show that it is faster to sort Document than to sort WorkingSetMember. The system is currently always sorting WorkingSetMember objects, even in the context of DocumentSource execution, where a WorkingSetMember must be created to contain the Document. We can optimize sorts that take place in the DocumentSource layer by sorting the Document objects directly.

      In the future, we could also use the templated SortExecutor in order to optimize the SortStage itself: for fetched data, it's likely faster to sort Document or even BSONObj in the PlanStage layer.

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: