Skip to content

Commit a703c2a

Browse files
npentreljeff-allen-mongo
authored andcommitted
DOCS-13943 Add plan cache limit and stats
1 parent a8f23e8 commit a703c2a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

source/core/query-plans.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,29 @@ The plan cache does not persist if a :binary:`~bin.mongod` restarts or shuts dow
7272
entire plan cache. Users can also clear particular plan cache entries using
7373
:method:`PlanCache.clearPlansByQuery()`.
7474

75+
Plan Cache Debug Info Size Limit
76+
--------------------------------
77+
78+
Starting in 4.0.23 (and 3.6.23), the
79+
:doc:`plan cache </core/query-plans>` will save full ``plan cache``
80+
entries only if the cumulative size of the ``plan caches`` for all
81+
collections is lower than 0.5 GB. When the cumulative size of the
82+
``plan caches`` for all collections exceeds this threshold, additional
83+
``plan cache`` entries are stored with stripped debug information.
84+
85+
When ``plan cache`` entries are stored with stripped debug information,
86+
the :dbcommand:`planCacheListQueryShapes` command output displays an
87+
empty document in the ``shapes`` array for each each plan cache entry for
88+
which debug information was stripped. Similarly, detailed execution
89+
statistics for the candidate plans are omitted from the
90+
:dbcommand:`planCacheListPlans` command output when ``plan cache``
91+
entries are stored with stripped debug information. When debug info is
92+
present, you can find these detailed statistics in the ``plans.reason``
93+
field.
94+
95+
The estimated size in bytes of a ``plan cache`` entry is available in
96+
the output of :dbcommand:`planCacheListPlans`.
97+
7598
.. _index-filters:
7699

77100
Index Filters

0 commit comments

Comments
 (0)