Delayed Index Updates?

69 views
Skip to first unread message

Stefan Podkowinski

unread,
Sep 2, 2011, 3:26:52 AM9/2/11
to mongod...@googlegroups.com
My application consumes a steady streams of events and writes it to MongoDB. There are a lot of index updates involved in this process. Performance is reasonable so far. Sometimes however, I need to import or re-import a large chunk of data, which turns out to be really slow and will impact the performance of the "live" import as well. 

I've been running some tests and figured out that dropping all indexes would allow me to do this kind of extra work more efficiently. Those indexes are not very critical to my application and don't need to be fresh all the time. On the other hand I can't drop and recreate them every time, as they are quite large and I need to do extra imports almost daily. So my question is, is there a way to do updates on indexes at a later time of the day running in the background? Something like "db.things.updateIndex({x:1}, {background:true})" would be really cool to have in my case. 


Nat

unread,
Sep 2, 2011, 4:58:55 AM9/2/11
to mongod...@googlegroups.com
Not really. Your best shot is probably syncing it with another collection in other database that have proper indexes when needed and run query on that collection instead.

Scott Hernandez

unread,
Sep 2, 2011, 6:42:17 AM9/2/11
to mongod...@googlegroups.com
No, that concept, of not having the indexes always be up to date
(live), is counter to how indexes work and the concept behind having
them.

Please feel free to add a jira feature request here, or just describe
the scenario you want better support for: http://jira.mongodb.org/

> --
> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/mongodb-user/-/2D_Usmwh55cJ.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to
> mongodb-user...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mongodb-user?hl=en.
>

Reply all
Reply to author
Forward
0 new messages