mongodb - Do we need to set the index on the collection for the order by fields also? -


i have read removing unncecessary index can improve mongodb's performance lot . working on application dependent on mongodb heavily . have seen of queries inside application querying data using order on 2 attributes of document .

my question

do need set index on collection order fields also?

thanks in advance.

i think so. refer: http://docs.mongodb.org/manual/tutorial/sort-results-with-indexes/ says:

in mongodb sort operations sort documents based on indexed field provide greatest performance. indexes in mongodb, in other databases, have order: result, using index access documents returns in same order index.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -