From 143af3d0886e4731f7382940935db750824ef8f2 Mon Sep 17 00:00:00 2001 From: Naomi Pentrel <5212232+npentrel@users.noreply.github.com> Date: Thu, 25 Mar 2021 13:32:26 +0100 Subject: [PATCH] DOCS-13943 Add plan cache limit and stats --- source/core/query-plans.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/source/core/query-plans.txt b/source/core/query-plans.txt index d430bc2549a..c0f0344fcfe 100644 --- a/source/core/query-plans.txt +++ b/source/core/query-plans.txt @@ -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 ` 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