Slow sorting on indexed _id field


In testing document layer we are seeing very poor performance when sorting by _id, we have run createIndex/ensureIndex and while that eats all document layer cpu for a long time, we don’t see an improvement in performance after completion. The FoundationDB cluster itself is practically idle when either using sort on _id or creating the index however document layer cpu is maxed. Other, keyed queries are very fast during both these actions showing that foundation db is not the bottle neck. Is there anything we are doing wrong or something we can do to improve performance on sort requests? We ask because these are very common uses of mongo according to our DBA team.

(Bhaskar Muppana) #2

Yeah, this is one of the major issues we want to fix very soon. At the moment, document layer doesn’t use indexes for any sort(). This includes even the primary index, _id. Sorting happens on the documents in memeory. That is the reason why you see document layer being too busy while FoundationDB servers being idle

Targeting to fix this in next couple of releases. Here is the issue for it