-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.6.3
-
Component/s: Aggregation Framework, Diagnostics, Querying
-
None
-
ALL
Running explain on an aggregation pipeline returns the error "No plan available to provide stats" if the query issued by the $cursor stage is not cached and has multiple candidate plans.
Reproduces on 2.6.0 through 2.6.3. Does not reproduce on master.
> db.foo.drop() true > db.foo.ensureIndex({a:1}) { "createdCollectionAutomatically" : true, "numIndexesBefore" : 1, "numIndexesAfter" : 2, "ok" : 1 } > db.foo.ensureIndex({b:1}) { "createdCollectionAutomatically" : false, "numIndexesBefore" : 2, "numIndexesAfter" : 3, "ok" : 1 } > db.foo.insert({a:1,b:2}) WriteResult({ "nInserted" : 1 }) > db.foo.insert({a:1,b:2}) WriteResult({ "nInserted" : 1 }) > db.foo.insert({a:1,b:2}) WriteResult({ "nInserted" : 1 }) > db.foo.aggregate([{$match: {a:1,b:1}}],{explain:true}) { "stages" : [ { "$cursor" : { "query" : { "a" : 1, "b" : 1 }, "planError" : "InternalError No plan available to provide stats" } } ], "ok" : 1 } >
Originally reported on mongodb-user: <https://groups.google.com/forum/#!topic/mongodb-user/TwK0wKr45Bk>.