indexing - How often shall we reindex the geospatial data in mongodb? -


i wonder if must of reindexing geospatial data in mongodb if there new geo-data has been inserted in order search them? have document,which looks like: {user:'a',loc:[363.236,-45.365]}, , indexed. later on, inserted document b, looks like: {user:'b',loc:{42.3654,-56.3}}. in order search, have reindex (using ensureindex()) collection every time when new document inserted? frequent reindexing affect overall application performance? thanks.

you need ensureindex once; after mongodb maintains index on every insert. i'm not 100% sure index maintained deletes though - imagine must do.

you can defragment index , rebuild make smaller, hence existence of functionality. useful post:

http://jasonwilder.com/blog/2012/02/08/optimizing-mongodb-indexes/


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -