-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.0.5
-
Component/s: Querying
-
None
-
Environment:RHEL
-
ALL
db.Example.find({ $and: [
{ lc: "eng" }, { wordCount:
{ $gte: 4 }}, { wordCount:
{ $lte: 5 }}, { $or: [
{ group: "transmachina" },
{ group: "all" }] },
{pattern: false}, { "indices.textLc":
{ $in: [ "plain text", "plain", "text" ] }} ] }).explain();
gives
{
"cursor" : "BtreeCursor indices.textLc_1_group_1_lc_1_wordCount_1_pattern_1_clExists_1 multi",
"nscanned" : 7571,
"nscannedObjects" : 7513,
"n" : 97,
"millis" : 78429,
"nYields" : 1143,
"nChunkSkips" : 0,
"isMultiKey" : true,
"indexOnly" : false,
"indexBounds" : {
"indices.textLc" : [
[
"plain",
"plain"
],
[
"plain text",
"plain text"
],
[
"text",
"text"
]
],
"group" : [
[
,
{ "$maxElement" : 1 } ]
],
"lc" : [
[
"eng",
"eng"
]
],
"wordCount" : [
[
4,
1.7976931348623157e+308
]
],
"pattern" : [
[
false,
false
]
],
"clExists" : [
[
,
{ "$maxElement" : 1 } ]
]
}
}
Note that the limit { wordCount:
{ $lte: 5 }} is ignored and thousands of objects are scanned needlessly
- duplicates
-
SERVER-4180 Allow multiple constraints (on same field) within a $elemMatch clause to be used with a multikey index
- Closed