[DOCS-5150] PlanCache.listQueryShapes() need clearer explanation Created: 01/Apr/15  Updated: 30/Oct/23  Resolved: 10/Feb/16

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: mongodb-3.0
Fix Version/s: Server_Docs_20231030

Type: Improvement Priority: Major - P3
Reporter: Buzz Moschetti Assignee: Allison Reinheimer Moore
Resolution: Done Votes: 0
Labels: query
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 8 years, 1 week ago

 Description   

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.



 Comments   
Comment by Githook User [ 10/Feb/16 ]

Author:

{u'username': u'schmalliso', u'name': u'Allison Moore', u'email': u'allison.moore@10gen.com'}

Message: DOCS-5150: clarifies behavior when no plans in cache
Branch: master
https://github.com/mongodb/docs/commit/c1c61557f0740d7ecf447d80fa612d595dc72dba

Generated at Thu Feb 08 07:49:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.