Improve cluster distinct command to skip aggregating results when targeting a single shard

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      At the time of writing, the cluster distinct command sets up a BSONObjSet to deduplicate results across shards. In the general case this is necessary, but when targeting a single shard, this is unnecessary. As such, this ticket tracks the work to return the lone shard response directly in the case of targeting a single shard.

      For context, we target a single shard when:

      • The target namespace is unsharded (either untracked or unsplittable)
      • The target namespace is sharded and all targeted chunks reside on a single shard

            Assignee:
            Unassigned
            Reporter:
            Mihai Andrei
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: