Optimize the aggregation pipeline used by analyzeShardKey command to calculate cardinality and frequency

XMLWordPrintableJSON

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

      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%.

              Assignee:
              Cheahuychou Mao
              Reporter:
              Cheahuychou Mao
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: