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

Is an db.collection.reIndex() required after adding indexes to a collection.

    • Type: Icon: Question Question
    • Resolution: Cannot Reproduce
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.6.1
    • Component/s: Index Maintenance
    • Labels:
    • Environment:
      We are running MongoDB version 1.6.5 on CentOS release 5.5 (Final).

      On a mongo collection with 1.8 Million documents the following steps were taken:
      > db.collection.dropIndexes()
      > db.collection.ensureIndex() // ran this multiple times for the various indexes on it the collection

      At this point the RPS of the application, and mongo's throughput were a quarter of what they were before the indexes were dropped and readded.
      Then i ran a
      > db.collection.reIndex()
      Which brought the throughput and the RPS back up to the levels it was before the indexes were dropped.

      What i wanted to know was is this expected behavior, and is it recommended to run a reIndex after an index is added to an existing collection.

            Assignee:
            Unassigned Unassigned
            Reporter:
            puneet.kandhari@demandmedia.com Puneet Kandhari
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: