Queries with projection {a:1.0} should not be considered of a different shape than queries with projection {a:NumberInt(1)}. This can be particularly confusing to users of the plan cache shell helpers, who will see shapes seemingly listed twice when in fact they differ in the BSON type of the projection (as the shell renders them identically).
> db.foo.getPlanCache().clear() > db.foo.find({a:1,b:1},{a:1}) > db.foo.getPlanCache().listQueryShapes() [ { "query" : { "a" : 1, "b" : 1 }, "sort" : { }, "projection" : { "a" : 1 } } ] > db.foo.find({a:1,b:1},{a:NumberInt(1)}) > db.foo.getPlanCache().listQueryShapes() [ { // first query "query" : { "a" : 1, "b" : 1 }, "sort" : { }, "projection" : { "a" : 1 } }, { // second query, but looks the same "query" : { "a" : 1, "b" : 1 }, "sort" : { }, "projection" : { "a" : 1 } } ] >
- depends on
-
SERVER-16577 2.8 doesn't have a field to report if query cache plan filters are used in explain
- Closed
- is duplicated by
-
SERVER-16330 plan cache filters aren't applied if mongoS rewrites the projection of a query
- Closed
-
SERVER-26796 planCacheSetFilter doesn't work for queries emitted by pymongo to MongoDB 2.6 if projection is not empty
- Closed
- related to
-
SERVER-12843 Encoding of projection for query plan cache should be order-insensitive
- Closed
- links to