Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Duplicate
-
2.6.0
-
None
-
None
-
ALL
Description
Insert some documents
var f = 10
|
var n = 100000
|
|
doc = {}
|
for (var i=0; i<f; i++)
|
doc[i] = i
|
|
db.c.drop()
|
for (var i=0; i<n; i++)
|
db.c.insert(doc)
|
Skip over all but 1 using _id index, get the last:
db.c.find().hint({_id:1}).skip(n-1).next()
|
Performs about 2x worse in 2.6.4 than 2.4.10:
v 2.4.10 n 100000 f 10 t 49
|
v 2.6.4 n 100000 f 10 t 93
|
The reason seems to be that mongod is fetching the skipped documents in 2.6.x but not in 2.4.x, so the ratio could be much worse if the collection doesn't fit in memory and the skipped documents must be paged in.
Attachments
Issue Links
- duplicates
-
SERVER-13946 Consider putting skip stages below fetch stages
-
- Closed
-