Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-77918

Make monotonicity calculation in analyzeShardKey command avoid unnecessary shard key extraction and comparison

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0, 7.0.0-rc5
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Fully Compatible
    • v7.0
    • Sharding NYC 2023-06-12, Sharding NYC 2023-06-26

      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. 

            Assignee:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Reporter:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: