[DOCS-15054] [Server] Investigate changes in SERVER-57383: Include merge sort in sharded aggregation explain output Created: 20/Jan/22  Updated: 22/Jan/24

Status: Backlog
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: 5.3.0

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: backlog, feature, query, sharding
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-57383 Include merge sort in sharded aggrega... Closed
Participants:
Days since reply: 2 years, 2 weeks, 6 days ago
Epic Link: DOCSP-19447

 Description   
Downstream Change Summary

This ticket changes explain output for queries against sharded collections, adding the $mergeCursors stage to the front of the mergerPart of the split pipeline.

Description of Linked Ticket

At some point before 4.2 we stopped including the merge sort in the explain output - I believe because the merge sort started happening within the $mergeCursors, which is not created nor displayed in explain output.

We should somehow enhance the explain output to include the merge sort so that users don't mistakenly conclude that the merged output is not sorted.

 
4.0:

splitPipeline: {
  shardsPart: [
    {
      '$match': { mykey: { '$in': [ 0, 1, 3, 7 ] } }
    },
    { '$sort': { sortKey: { favColour: 1 }, limit: 5 } }
  ],
  mergerPart: [
    {
      '$sort': { sortKey: { favColour: 1 }, mergePresorted: true, limit: 5 }
    }
  ]
}

4.2/4.4:

 
splitPipeline: {
  shardsPart: [
    {
      '$match': { mykey: { '$in': [ 0, 1, 3, 7 ] } }
    },
    { '$sort': { sortKey: { favColour: 1 }, limit: 5 } }
  ],
  mergerPart: [ { '$limit': 5 } ]
}

 



 Comments   
Comment by PM Bot [ 20/Jan/22 ]

Downstream changes updated for upstream SERVER-57383:
This ticket changes explain output for queries against sharded collections, adding the $mergeCursors stage to the front of the mergerPart of the split pipeline.

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