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

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

    XMLWordPrintableJSON

Details

    • Icon: Question Question
    • Resolution: Cannot Reproduce
    • Icon: Major - P3 Major - P3
    • None
    • 1.6.1
    • Index Maintenance
    • We are running MongoDB version 1.6.5 on CentOS release 5.5 (Final).

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: