[SERVER-3059] Is an db.collection.reIndex() required after adding indexes to a collection. Created: 06/May/11  Updated: 30/Mar/12  Resolved: 07/May/11

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 1.6.1
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Puneet Kandhari Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: indexing
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

We are running MongoDB version 1.6.5 on CentOS release 5.5 (Final).


Participants:

 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.



 Comments   
Comment by Eliot Horowitz (Inactive) [ 07/May/11 ]

If you have all of the logs and statistics from when you did it, that would be great.

Or a script that reproduces the issue.

Comment by Puneet Kandhari [ 07/May/11 ]

What information can i provide for reproducing the error.

Comment by Eliot Horowitz (Inactive) [ 07/May/11 ]

Doesn't sound expected, but a little hard to follow without more information.

You definitely do not need to reIndex after adding an index

Generated at Thu Feb 08 03:01:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.