Quantcast
Channel: Joe Stevens' Blog » MongoDB
Viewing all articles
Browse latest Browse all 5

MongoDB Sorting and Indexes

$
0
0
I’ve been looking at some of my MongoDB queries and trying to optimise them. I had one query that did a few ‘in’ statement and then sorted on a field called CreatedTime in descending order to give me the latest documents first. My index looked something like: { “Field1″ : 1, “Field2″ : 1, “Field3″ : 1, “CreatedTime” -1 } With this index I got the following information from the Explain method: “nscanned” : 8120, “nscannedObjects” : 4364, “n” : …

Viewing all articles
Browse latest Browse all 5

Trending Articles