@@ -129,6 +129,7 @@ document similar to the following:
129129 ...
130130 ],
131131 "indexFilterSet" : <boolean>,
132+ "estimatedSizeBytes" : <num>, // Available starting in MongoDB 5.0, 4.4.3, 4.2.12, 4.0.23, 3.6.23
132133 "host" : <string>, // Available starting in MongoDB 4.4
133134 "shard" : <string> // Available starting in MongoDB 4.4 if run on sharded cluster
134135 }
@@ -189,9 +190,11 @@ including:
189190 currently available indexes for that shape. For more information, see
190191 :data:`explain.queryPlanner.planCacheKey`
191192
192- * - `` cachedPlan` `
193+ * - :ref:` cachedPlan <plancachestats-cachedPlan> `
193194
194- - The details of the cached plan. See :data:`explain.queryPlanner`.
195+ - .. _plancachestats-cachedPlan:
196+
197+ The details of the cached plan. See :data:`explain.queryPlanner`.
195198
196199 * - ``works``
197200
@@ -203,24 +206,36 @@ including:
203206 * - ``timeOfCreation``
204207 - Time of creation for the entry.
205208
206- * - ``creationExecStats``
209+ * - :ref:`creationExecStats <plancachestats-creationExecStats>`
210+
211+ - .. _plancachestats-creationExecStats:
207212
208- - An array of execution stats documents. The array contains a
213+ An array of execution stats documents. The array contains a
209214 document for each candidate plan.
210215
211216 For details on the execution stats, see
212217 :data:`explain.executionStats`.
213218
214- * - ``candidatePlanScores``
219+ * - :ref:`candidatePlanScores <plancachestats-candidatePlanScores>`
220+
221+ - .. _plancachestats-candidatePlanScores:
215222
216- - An array of scores for the candidate plans listed in the
223+ An array of scores for the candidate plans listed in the
217224 ``creationExecStats`` array.
218225
219226 * - ``indexFilterSet``
220227
221228 - A boolean that indicates whether the an :ref:`index filter
222229 <index-filters>` exists for the query shape.
223230
231+ * - ``estimatedSizeBytes``
232+
233+ - A number that describes the estimated size in bytes of a plan
234+ cache entry.
235+
236+ .. versionadded:: 5.0 (*Also available starting in 4.4.3, 4.2.12,
237+ 4.0.23, and 3.6.23*)
238+
224239 * - :ref:`host <plancachestats-host>`
225240
226241 - .. _plancachestats-host:
@@ -330,6 +345,7 @@ The operation returns all entries in the cache:
330345 1.5002
331346 ],
332347 "indexFilterSet" : false,
348+ "estimatedSizeBytes" : NumberLong(3160), // Available starting in MongoDB 5.0, 4.4.3, 4.2.12, 4.0.23, 3.6.23
333349 "host" : "mongodb1.example.net:27018", // Available starting in MongoDB 4.4
334350 "shard" : "shardA" // Available starting in MongoDB 4.4 if run on sharded cluster
335351 }
@@ -360,6 +376,7 @@ The operation returns all entries in the cache:
360376 1.0002
361377 ],
362378 "indexFilterSet" : false,
379+ "estimatedSizeBytes" : NumberLong(2539), // Available starting in MongoDB 5.0, 4.4.3, 4.2.12, 4.0.23, 3.6.23
363380 "host" : "mongodb1.example.net:27018", // Available starting in MongoDB 4.4
364381 "shard" : "shardA" // Available starting in MongoDB 4.4 if run on sharded cluster
365382 }
@@ -390,6 +407,7 @@ The operation returns all entries in the cache:
390407 1.7502
391408 ],
392409 "indexFilterSet" : false,
410+ "estimatedSizeBytes" : NumberLong(3183), // Available starting in MongoDB 5.0, 4.4.3, 4.2.12, 4.0.23, 3.6.23
393411 "host" : "mongodb1.example.net:27018", // Available starting in MongoDB 4.4
394412 "shard" : "shardA" // Available starting in MongoDB 4.4 if run on sharded cluster
395413 }
@@ -424,6 +442,7 @@ The operation returns all entries in the cache:
424442 1.6668666666666665
425443 ],
426444 "indexFilterSet" : false,
445+ "estimatedSizeBytes" : NumberLong(4653), // Available starting in MongoDB 5.0, 4.4.3, 4.2.12, 4.0.23, 3.6.23
427446 "host" : "mongodb1.example.net:27018", // Available starting in MongoDB 4.4
428447 "shard" : "shardA" // Available starting in MongoDB 4.4 if run on sharded cluster
429448 }
@@ -476,7 +495,7 @@ specific information for a particular query shape:
476495
477496.. code-block:: javascript
478497
479- db.orders.aggregate( [
498+ db.orders.aggregate( [
480499 { $planCacheStats: { } },
481500 { $match: { planCacheKey: "DD67E353"} }
482501 ] )
@@ -485,7 +504,7 @@ The operation returns the following:
485504
486505.. code-block:: javascript
487506 :copyable: false
488-
507+
489508 {
490509 "createdFromQuery" : {
491510 "query" : { "quantity" : { "$gte" : 5 }, "type" : "apparel" },
@@ -651,6 +670,7 @@ The operation returns the following:
651670 1.5002
652671 ],
653672 "indexFilterSet" : false,
673+ "estimatedSizeBytes" : NumberLong(3160), // Available starting in MongoDB 5.0, 4.4.3, 4.2.12, 4.0.23, 3.6.23
654674 "host" : "mongodb1.example.net:27018", // Available starting in MongoDB 4.4
655675 "shard" : "shardA" // Available starting in MongoDB 4.4 if run on sharded cluster
656676 }
0 commit comments