|
The doc on this page
http://docs.mongodb.org/manual/reference/method/PlanCache.listQueryShapes/#PlanCache.listQueryShapes
|
says this:
Example
|
|
The following returns the query shapes that have cached plans for the orders collection:
|
|
db.orders.getPlanCache().listQueryShapes()
|
The method returns an array of the query shapes currently in the cache. In the example, the orders collection had cached query plans associated with the following shapes:
|
|
[
|
{
|
"query" : { "qty" : { "$gt" : 10 } },
|
"sort" : { "ord_date" : 1 },
|
...
|
"Blindly" trying the example may not yield any plans on your test collection because not all query plans are cached by the engine. The language
The following returns the query shapes that have cached plans for the orders collection:
|
is therefore not technically wrong but it is very easy to misinterpret. We should add one of those yellow "Important" boxes with an explanation that not all queries automatically place at least one plan in the cache.
|