Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-10112

Choosing a shard key should explain how only the first field in a compound shard key is used to select the shard for the data

    • Type: Icon: Task Task
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • Affects Version/s: None
    • Component/s: manual
    • Labels:
      None

      The documentation here https://docs.mongodb.com/manual/core/sharding-shard-key/#choosing-a-shard-key doesn't mention that when using a compound shard key, only the first field in the key is used to determine on what shard the data resides. Other fields are used to help improve cardinality, and spread data across chunks, but not across shards.

      Since shard keys are immutable, this turns out to be a very important fact.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jimreitz James Reitz
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              1 year, 26 weeks, 4 days ago