-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: manual
-
Labels:None
----------------------------
Original Description
Description:
This is a new aggregation stage which needs to be documented in the manual. The details are available in the scope for this project: https://docs.google.com/document/d/1imZ9_BNJUEbBupGEg0JuMDSwHdGkCM8br85CDEkJYqU/edit. Either Storch or Ian Boros are available for questions and to review any docs changes.
{$planCacheStats: {}} can be added at the beginning of an aggregation pipeline. The resulting cursor will return one document per plan cache entry for the collection over which the aggregation is issued. The format in which the plan cache entry is represented differs from that of the 'planCacheListPlans' command, but the information available is similar. This is useful for debugging/diagnosis when the plan cache is suspected as involved in a query performance issue.
Users should typically prefer $planCacheStats over the 'planCacheListPlans' and 'planCacheListQueryShapes' commands. We may want to add a note about this on the docs pages for those commands.
It may be valuable to show an example in which a $planCacheStats stage with a subsequent $match on 'queryHash' is used to lookup information for a particular cache entry.
If auth is enabled, reading the plan cache requires the 'planCacheRead' action type on the collection.
----------------------------
Description
Scope of changes (files that need work and how much)
- 4.2.txt
- planCacheStats
- query-plans
- Security: privilege-actions
- restrictions:
- facets
- as part of txn operations (txn operations, aggregation command/method)
- local read concern -> causal consistent session
- Preference over existing
- planCacheListPlans/planCacheListQueryShapes/PlanCache.listQueryShapes/PlanCache.getPlansByQuery
- Add references to new stage
- explain
- index-partial
- measure-index-use
Impact to other docs outside of this product
MVP (work and date?)
Resources (e.g. Scope Docs, Invision)
- documents
-
SERVER-36528 Implement $planCacheStats aggregation metadata source
- Closed
- is related to
-
DOCS-11959 Docs for SERVER-36527: Include queryHash in explain output
- Closed
-
DOCS-11962 Docs for SERVER-35981: Include hash of plan cache key in planCacheListShapes and planCacheListPlans
- Closed
-
DOCS-11965 Docs for SERVER-23332: Expose query plan cache key in system.profile entry and query log lines
- Closed
- related to
-
DOCS-12387 Docs for SERVER-33303: Modifying indexes impacts application of index filters
- Closed