Details
-
Bug
-
Resolution: Duplicate
-
Major - P3
-
None
-
2.0.4
-
None
-
Window 7, single node
-
ALL
Description
I was working through the exercises in the training course in the indexing section. As a variation from the instructions, one of the students tried to explain() what should have been an index-only query, but it was not reported as such by explain. To recreate, load the twitter.tweets collection from the training sample data set. Then:
> db.tweets.find({'user.friends_count:{$gt:100},
|
'user.followers_count':{$gt:100}},
|
{'user.friends_count':1, _id:0}).explain();
|
|
|
{
|
"cursor" : "BtreeCursor user.friends_count_1_user.followers_count_1",
|
"nscanned" : 26377,
|
"nscannedObjects" : 25984,
|
"n" : 25984,
|
"millis" : 458,
|
"nYields" : 0,
|
"nChunkSkips" : 0,
|
"isMultiKey" : false,
|
"indexOnly" : false,
|
"indexBounds" : {
|
"user.friends_count" : [
|
[
|
100,
|
1.7976931348623157e+308
|
]
|
],
|
"user.followers_count" : [
|
[
|
100,
|
1.7976931348623157e+308
|
]
|
]
|
}
|
}
|
>
|
Note the indexOnly field in the explain() result is false, even though the selection list only includes the first field of the index key.
Attachments
Issue Links
- duplicates
-
SERVER-2104 covered index should support dotted fields
-
- Closed
-