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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • None
    • manual
    • None

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              1 year, 14 weeks, 2 days ago