[SERVER-27846] Improve performance of the update path's $push sort Created: 27/Jan/17  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Write Ops
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: James Wahlin Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 4
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-27842 Replace BSONElement.fieldName() calls... Closed
Assigned Teams:
Query Execution
Participants:
Case:

 Description   

Currently the sort used for $push with $sort will extract sort keys in the sort comparator, once for each comparison. The key extraction is expensive and can be reduced by extracting prior to the sort.

We should also consider adding optimization for insertion into an already sorted array.


Generated at Thu Feb 08 04:16:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.