Question About Indexes

2 views
Skip to first unread message

John Nunemaker

unread,
Dec 18, 2009, 11:04:10 PM12/18/09
to mongod...@googlegroups.com
Rick commented on a post of mine about mongo with a question regarding indexes:


"What’s the index story like on Mongo? Can you create/drop indexes on the fly, or does it lock the collection?"

I responded with:

"You’d have to hit the mailing list. I assume lots of data plus a new index on an existing key would lock/slow things up. Good question"

And decided to ask the mailing list for him. How does it work adding an index to a key that is in a bunch of documents in a large collection? Also, if you add an index to a key that is new to a collection is there any hit to that? Thanks!

John

Eliot Horowitz

unread,
Dec 18, 2009, 11:19:24 PM12/18/09
to mongod...@googlegroups.com
Creating a new index blocks. It doesn't matter as all objects go into
the index even if an object doesn't have a given field.

> --
>
> 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.
> For more options, visit this group at
> http://groups.google.com/group/mongodb-user?hl=en.
>

jnunemaker

unread,
Dec 18, 2009, 11:23:48 PM12/18/09
to mongodb-user
Thanks!

On Dec 18, 11:19 pm, Eliot Horowitz <eliothorow...@gmail.com> wrote:
> Creating a new index blocks.  It doesn't matter as all objects go into
> the index even if an object doesn't have a given field.
>
>
>
> On Fri, Dec 18, 2009 at 11:04 PM, John Nunemaker <nunema...@gmail.com> wrote:
> > Rick commented on a post of mine about mongo with a question regarding
> > indexes:

> >http://railstips.org/2009/12/18/why-i-think-mongo-is-to-databases-wha...

Reply all
Reply to author
Forward
0 new messages