-
Type:
Bug
-
Resolution: Duplicate
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Querying
-
None
-
ALL
-
None
-
None
-
None
-
None
-
None
-
None
-
None
In following example, collection has 3 matching docs on condition, and is using index to match.
If adding a skip(2), it only returns 1 document.
You would expect nscanned=3 but nscannedObjects should be 1, not 3, since 2 docs are skipped.
Is that just counting bug or are we actually looking at docs, which would make skip very inefficient?
foo:PRIMARY> db.testindex.find({a:5}).skip(2).explain()
{
"cursor" : "BtreeCursor a_1",
"nscanned" : 3,
"nscannedObjects" : 3,
"n" : 1,
"millis" : 0,
"nYields" : 0,
"nChunkSkips" : 0,
"isMultiKey" : true,
"indexOnly" : false,
"indexBounds" : {
"a" : [
[
5,
5
]
]
}
}
- duplicates
-
SERVER-13946 Consider putting skip stages below fetch stages
-
- Closed
-
- related to
-
SERVER-10448 Revamp explain() formatting
-
- Closed
-