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

Make analyzeShardKey command use the most compatible index to calculate cardinality and frequency metrics

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 7.0.0-rc0
    • None
    • None
    • None
    • Fully Compatible
    • ALL
    • Sharding NYC 2023-03-20

    Description

      The analyzeShardKey command currently simply uses the first prefixed index that it sees when it goes through the indexes in the IndexCatalog. However, consider the case the shard key being analyzed is {x: 1} and the collection has two indexes {x: 1, y: 1} which is a not unique index and
      {x: 1} which is a unique index. If the index {x: 1, y: 1} shows up first in the IndexCatalog then the command would return the the shard key is not unique although it is. 

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: