Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-2758

Consider compound indexes in shardcollection command

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Minor - P4 Minor - P4
    • None
    • 1.8.0-rc1
    • None
    • None

    Description

      When using shardcollection with a key that is a prefix of an existing compound index, one gets a message 'please create an index over the sharding key before sharding.', even though the compound index could have been used for sharding.

      For instance:

      db.Test.save(

      { a:1, b:2, c: 3}

      )
      db.Test.ensureIndex (

      {a:1,b:1}

      )

      db.runCommand({shardcollection: "test.Test", key: {a:1}}) << use compound index on a,b here instead of giving error message

      Attachments

        Activity

          People

            Unassigned Unassigned
            jabernet Janick Bernet
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: