Can somebody explain how does index works in mongo? From what I read
we are to call ensureIndex method in our code instead of creating an
index one time like in RDBMS. CMIIW.
My question is:
1. Do we call ensureIndex every time we make a request to the database?
2. Would calling this on every request slows down the performance of
the web request?
Thanks heaps for your kind assistance.
Kind regards,
Joshua.
--
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.
Joshua Partogi wrote:
> Hi all,
>
> Can somebody explain how does index works in mongo? From what I read
> we are to call ensureIndex method in our code instead of creating an
> index one time like in RDBMS.
Sorry, this is nonsense. Indexes basically work the same way as in a
RDBMS: you create them once and that's it. As with an index in a RDBMS:
you can create and drop and re-create them at runtime. The only slightly
difference is perhaps that indexes in MongoDB can be created in background.
- -aj
CMIIW.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkxeaxQACgkQCJIWIbr9KYxmbACgunc44L7m+NRFCJa66oKoOSP5
wKwAoOAadRcNk7QsiOe30PbAMhJmOBTv
=9iVe
-----END PGP SIGNATURE-----