|
I can reproduce this issue using the script that Dave provided in his earlier comment against MongoDB versions 3.2.3 and 3.3.2. I cannot reproduce the issue after reverting the changes from SERVER-22448.
{
|
"queryPlanner" : {
|
"plannerVersion" : 1,
|
"namespace" : "test.test",
|
"indexFilterSet" : false,
|
"parsedQuery" : {
|
...
|
},
|
"winningPlan" : {
|
"stage" : "FETCH",
|
"filter" : {
|
...
|
},
|
"inputStage" : {
|
"stage" : "IXSCAN",
|
"keyPattern" : {
|
"array.value1" : 1,
|
"array.value2" : 1,
|
"point" : "2dsphere"
|
},
|
"indexName" : "array.value1_1_array.value2_1_point_2dsphere",
|
"isMultiKey" : true,
|
"isUnique" : false,
|
"isSparse" : false,
|
"isPartial" : false,
|
"indexVersion" : 1,
|
"direction" : "forward",
|
"indexBounds" : {
|
"array.value1" : [
|
"[MinKey, MaxKey]"
|
],
|
"array.value2" : [
|
"[MinKey, MaxKey]"
|
],
|
"point" : [
|
"[MinKey, MaxKey]"
|
]
|
}
|
}
|
},
|
"rejectedPlans" : [ ]
|
},
|
"serverInfo" : {
|
"host" : "gopher-blue",
|
"port" : 27017,
|
"version" : "3.2.4",
|
"gitVersion" : "e2ee9ffcf9f5a94fad76802e28cc978718bb7a30"
|
},
|
"ok" : 1
|
}
|
|
|
alex.komyagin, I believe I ran exactly your query against a recent build of the master branch, and I could not reproduce. Here's my script, taken nearly verbatim from the ticket description:
(function() {
|
db.test.insert({
|
point : {
|
"type" : "MultiPolygon",
|
"coordinates" : [
|
[[ [ 30, 20 ], [ 45, 40 ], [ 10, 40 ], [ 30, 20 ] ]],
|
[[ [ 15, 5 ], [ 40, 10 ], [ 10, 20 ], [ 5, 10 ], [ 15, 5 ] ]]
|
]
|
},
|
array : [ {value1 : 1, value2 : 2}, {value1 : 5, value2 : 10} ]
|
});
|
|
db.test.ensureIndex({'array.value1': 1,'array.value2': 1, point: "2dsphere"});
|
|
var explain = db.test.find({
|
point: {$geoWithin: {$geometry: {
|
"type": "MultiPolygon",
|
"coordinates": [
|
[[ [30, 20], [45, 40], [10, 40], [30, 20] ]],
|
[[ [15, 5], [40, 10], [10, 20], [5, 10], [15, 5] ]]
|
]
|
}}},
|
array: {$elemMatch: {value1: 1, value2: 2}}
|
}).hint("array.value1_1_array.value2_1_point_2dsphere").explain();
|
|
printjson(explain);
|
})();
|
This produces index bounds that look correct to me:
"array.value1" : [
|
"[1.0, 1.0]"
|
],
|
"array.value2" : [
|
"[2.0, 2.0]"
|
],
|
"point" : [
|
"[1152921504606846977, 1188950301625810943]",
|
"[1206964700135292928, 1206964700135292928]",
|
"[1206964700135292929, 1215971899390033919]",
|
"[1215971899390033921, 1224979098644774911]",
|
"[1224979098644774912, 1224979098644774912]",
|
"[1224979098644774913, 1261007895663738879]",
|
"[1261007895663738881, 1270015094918479871]",
|
"[1270015094918479873, 1279022294173220863]",
|
"[1279022294173220864, 1279022294173220864]",
|
"[1351079888211148800, 1351079888211148800]",
|
"[1355583487838519296, 1355583487838519296]",
|
"[1358961187559047168, 1358961187559047168]",
|
"[1359805612489179136, 1359805612489179136]",
|
"[1359946349977534465, 1360087087465889791]",
|
"[1369094286720630784, 1369094286720630784]",
|
"[1369094286720630785, 1405123083739594751]",
|
"[1405123083739594753, 1414130282994335743]",
|
"[1423137482249076736, 1423137482249076736]",
|
"[1441151880758558721, 1477180677777522687]",
|
"[1477180677777522689, 1513209474796486655]",
|
"[1513209474796486656, 1513209474796486656]",
|
"[1513209474796486657, 1549238271815450623]",
|
"[1560497270883876865, 1562749070697562111]",
|
"[1562749070697562112, 1562749070697562112]",
|
"[1567252670324932608, 1567252670324932608]",
|
"[1585267068834414593, 1621295865853378559]",
|
"[1621295865853378561, 1657324662872342527]",
|
"[1657324662872342528, 1657324662872342528]",
|
"[1657324662872342529, 1693353459891306495]",
|
"[4611686018427387905, 4620693217682128895]",
|
"[4629700416936869888, 4629700416936869888]",
|
"[4638707616191610881, 4647714815446351871]",
|
"[4647714815446351873, 4656722014701092863]",
|
"[4656722014701092865, 4656757199073181695]",
|
"[4656792383445270528, 4656792383445270528]",
|
"[4657003489677803520, 4657003489677803520]",
|
"[4657847914607935488, 4657847914607935488]",
|
"[4661225614328463360, 4661225614328463360]",
|
"[4665729213955833856, 4665729213955833856]",
|
"[4683743612465315840, 4683743612465315840]"
|
]
|
Could you please provide more detailed repro steps?
Best,
Dave
|