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

Investigate changes in SERVER-44701: Remove support for the plan cache introspection commands

      Description

      Downstream Change Summary

      The 'planCacheListPlans' command (https://docs.mongodb.com/manual/reference/command/planCacheListPlans/#dbcmd.planCacheListPlans) and 'planCacheListQueryShapes' command (https://docs.mongodb.com/manual/reference/command/planCacheListQueryShapes/#dbcmd.planCacheListQueryShapes) have been removed from the code base. They were deprecated in 4.2, and will be removed entirely in 4.4. We should note this in the 4.4 compatibility documentation, and also remove the reference pages. We expect users to migrate to the $planCacheStats aggregation source (https://docs.mongodb.com/manual/reference/operator/aggregation/planCacheStats/).

      There are also changes to the plan cache helpers in the shell that need to be documented. The PlanCache.getPlansByQuery() shell helper (https://docs.mongodb.com/manual/reference/method/PlanCache.getPlansByQuery/#PlanCache.getPlansByQuery) has been deleted. Similarly, PlanCache.listQueryShapes() was deleted (https://docs.mongodb.com/manual/reference/method/PlanCache.listQueryShapes/#PlanCache.listQueryShapes).

      Finally, this change adds a new plan cache helper to the shell called PlanCache.list(). It is sugar for $planCacheStats. It can be invoked as db.myCollection.getPlanCache().list() in order to obtain the entire contents of the plan cache for 'myCollection'. It optionally accepts a pipeline that can be used to transform the plan cache metadata using MQL, e.g. db.myCollection.getPlanCache().list([{$match: {queryHash: <hash>}}]).

      I don't think drivers changes will be needed, but I'm clicking the box just in case so that they get notified of this change. As far as I know, only the shell implements helpers for the plan cache commands.

      Description of Linked Ticket

      These commands were deprecated in 4.2. They have been superseded by $planCacheStats, which has a superior output format and returns a cursor rather than a large document which could exceed the 16MB BSON size limit. Removing them will eliminate legacy code that the query team currently has to maintain.

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              4 years, 2 weeks, 4 days ago