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

add createIndexes command

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.5
    • Affects Version/s: None
    • Component/s: Admin, Index Maintenance
    • None

      It seems like it would make sense to have a createIndex command; it would then round out the commands for all index operations (like deleteIndex, reIndex). Conceptually this seems consistent and would remove knowledge about "system.indexes" from within the drivers. Drivers can migrate to this syntax if they see the command available.

      This command should take an array of indexes to build in parallel (like compact does). Tools should be changed to use this command so that they are more efficient; then mongorestore can build all indexes at the same time.

      Possible format, which will be expanded in the next months:

      >db.coll.runCommand("createIndexes", {ensure:true ,indexes: 
        [
          {keys:{}, option1:.., option2:...},
          {keys:{}, option1:.., option2:...}
        ]})
      { ok:1.0, result: 
        { millis: ###,
          indexes: [ {status:"built/failed" <, nkeys: ##, millis: ###, nscannedObjects: ###, stats...>} ]
      }}
      
      

      The "indexes" field should also take a single doc, instead of an array, for simplicity.

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            scotthernandez Scott Hernandez (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: