[SERVER-78105] Optimize the aggregation pipeline used by analyzeShardKey command to calculate cardinality and frequency Created: 14/Jun/23  Updated: 29/Oct/23  Resolved: 15/Jun/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.0-rc0, 7.0.0-rc5

Type: Task Priority: Major - P3
Reporter: Cheahuychou Mao Assignee: Cheahuychou Mao
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
is related to SERVER-78147 Should be able to generate covered pl... Backlog
Backwards Compatibility: Fully Compatible
Backport Requested:
v7.0
Sprint: Sharding NYC 2023-06-26
Participants:

 Description   

According to the experiments in SERVER-68763, replacing the $setWindowFields+$limit stages with a $group stage with $topN decreased the runtime of the step to calculate the cardinality and frequency for a non-unique shard key index by about 20%.



 Comments   
Comment by Githook User [ 16/Jun/23 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}

Message: SERVER-78105 Optimize the aggregation pipeline used by analyzeShardKey command to calculate cardinality and frequency

(cherry picked from commit 89ee000ed1c70df1cb9c0bd70ea0d0e0bc3d93ec)
Branch: v7.0
https://github.com/mongodb/mongo/commit/7d177c9d90b5a5d9d3c0db6fbbe808c6b539ffd5

Comment by Githook User [ 15/Jun/23 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}

Message: SERVER-78105 Optimize the aggregation pipeline used by analyzeShardKey command to calculate cardinality and frequency
Branch: master
https://github.com/mongodb/mongo/commit/89ee000ed1c70df1cb9c0bd70ea0d0e0bc3d93ec

Generated at Thu Feb 08 06:37:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.