[SERVER-44324] Template SortExecutor to be able to sort either WorkingSetMember or Document, improving agg sort perf Created: 30/Oct/19  Updated: 29/Oct/23  Resolved: 04/Nov/19

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 4.3.1

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: David Storch
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Sprint: Query 2019-11-04, Query 2019-11-18
Participants:
Linked BF Score: 0

 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.



 Comments   
Comment by Githook User [ 04/Nov/19 ]

Author:

{'username': 'dstorch', 'email': 'david.storch@mongodb.com', 'name': 'David Storch'}

Message: SERVER-44324 Template the SortExecutor.

This improves the performance of blocking sort operations
executed in the agg layer of the execution tree.
Branch: master
https://github.com/mongodb/mongo/commit/b1ecef421c634b17d88eedc68864cdc886507dbe

Generated at Thu Feb 08 05:05:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.