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
Post a Comment