Skip to content

DOCS-13943 Add plan cache limit and stats #5164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions source/core/query-plans.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,29 @@ The plan cache does not persist if a :binary:`~bin.mongod` restarts or shuts dow
entire plan cache. Users can also clear particular plan cache entries using
:method:`PlanCache.clearPlansByQuery()`.

Plan Cache Debug Info Size Limit
--------------------------------

Starting in 4.0.23 (and 3.6.23), the
:doc:`plan cache </core/query-plans>` will save full ``plan cache``
entries only if the cumulative size of the ``plan caches`` for all
collections is lower than 0.5 GB. When the cumulative size of the
``plan caches`` for all collections exceeds this threshold, additional
``plan cache`` entries are stored with stripped debug information.

When ``plan cache`` entries are stored with stripped debug information,
the :dbcommand:`planCacheListQueryShapes` command output displays an
empty document in the ``shapes`` array for each each plan cache entry for
which debug information was stripped. Similarly, detailed execution
statistics for the candidate plans are omitted from the
:dbcommand:`planCacheListPlans` command output when ``plan cache``
entries are stored with stripped debug information. When debug info is
present, you can find these detailed statistics in the ``plans.reason``
field.

The estimated size in bytes of a ``plan cache`` entry is available in
the output of :dbcommand:`planCacheListPlans`.

.. _index-filters:

Index Filters
Expand Down