Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-11982

Docs for SERVER-36528: Implement $planCacheStats aggregation metadata source

      ----------------------------

      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)

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              5 years, 11 weeks, 3 days ago