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

Changing Shard Key Index; shard key index can be a compound index using the shard key as the prefix

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • None
    • Server
    • None
    • 2.2
    • true

    Description

      All versions:

      • you need to have an index on the shard key if the collection has data.
      • the collection doesn't have data, then shardcollection creates the index.

      For 2.2:

      • SERVER-1506, if you have an a,b index then your shard key can be a.
      • if you have an index on a, you can create an index on a,b and then drop index on a.
      • at any given time you must have one index that contains the shard key as a prefix.
        (Can't be a multi-key index.)

      Attachments

        Issue Links

          Activity

            People

              sam.kleinman Sam Kleinman (Inactive)
              matulef Kevin Matulef
              Jonathan Dahl Jonathan Dahl
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                10 years, 8 weeks ago