[SERVER-77918] Make monotonicity calculation in analyzeShardKey command avoid unnecessary shard key extraction and comparison Created: 08/Jun/23  Updated: 29/Oct/23  Resolved: 14/Jun/23

Status: Closed
Project: Core Server
Component/s: Sharding
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
Backwards Compatibility: Fully Compatible
Backport Requested:
v7.0
Sprint: Sharding NYC 2023-06-12, Sharding NYC 2023-06-26
Participants:

 Description   

The check involves scanning the supporting index to get the recordIds and checking that shard key isn't constant. The latter can be done without extracting the shard key value from every index key value and compare every pair of pervious and current value, i.e. we can skip extracting and comparing as long as more than one shard key value has been seen. The check was only necessary back when we use to exclude recordIds with the same shard key value from the correlation coefficient calculation in SERVER-74772. Skipping this might significantly reduce the latency of the monotonicity check. 



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

Author:

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

Message: SERVER-77918 Make monotonicity calculation in analyzeShardKey command avoid unnecessary shard key extraction and comparison

(cherry picked from commit cf00278a5230148eaf71c04df84f6c6de77decee)
Branch: v7.0
https://github.com/mongodb/mongo/commit/2b52a6c3cf6995c1b11632f04186c16d65bf6ed0

Comment by Githook User [ 14/Jun/23 ]

Author:

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

Message: SERVER-77918 Make monotonicity calculation in analyzeShardKey command avoid unnecessary shard key extraction and comparison
Branch: master
https://github.com/mongodb/mongo/commit/cf00278a5230148eaf71c04df84f6c6de77decee

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