Foreground vs. background index

419 views
Skip to first unread message

Ben McCann

unread,
Apr 19, 2013, 5:53:13 PM4/19/13
to mongod...@googlegroups.com
After the initial index creation, is there any difference between a foreground and background index? Will the indexes for subsequent items inserted be created differently depending upon this setting or is there any other difference?

Thanks,
Ben

Ben McCann

unread,
Apr 19, 2013, 7:34:53 PM4/19/13
to mongod...@googlegroups.com
Okay, thanks. The reason I was asking is because db.collection.getIndexes() shows { "background" : true } for several of my indexes and it seems very odd that it would inform of its original creation method if it made no difference.

Thanks!
-Ben


On Fri, Apr 19, 2013 at 3:24 PM, Alex Komyagin <alex.k...@10gen.com> wrote:
Hi Ben. If you are asking about "background" option for the db.collection.ensureIndex() command, there will be no difference once the index has been created.

Please note that creating index in foreground is much faster, but the collection will be unavailable for read/write access during the indexing process.

--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to a topic in the Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongodb-user/SHvB1fx35AI/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to mongodb-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
about.me/benmccann

Alexander Komyagin

unread,
Apr 19, 2013, 7:42:33 PM4/19/13
to mongod...@googlegroups.com
You are welcome, Ben!

There is no reason to worry, the 'background' option persists in the definition just as a reminder.

Best Regards,
Alexander Komyagin



Jeff Lee

unread,
Apr 19, 2013, 7:44:51 PM4/19/13
to mongod...@googlegroups.com
Hey Ben,

Also note that background index creation on a primary will turn into a foreground index creation on secondaries so be careful.

See the indexing docs ( http://docs.mongodb.org/manual/core/indexes/ ) for more details.

Cheers.


You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages