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

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3.1
    • Component/s: Querying
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: