Skip to content

Commit 3342338

Browse files
authored
DOCS 13445 adding details to query plans page (#4770) (#4848)
* DOCS-13445 adding details on cached query plans * DOCS-13445 adding details on cached query plans
1 parent 677d66d commit 3342338

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

source/core/query-plans.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ For a query, the MongoDB query optimizer chooses and caches the most
2020
efficient query plan given the available indexes. The evaluation of the
2121
most efficient query plan is based on the number of "work units"
2222
(``works``) performed by the query execution plan when the query planner
23-
evaluates candidate plans.
23+
evaluates candidate plans. In general, the MongoDB query planner
24+
selects query plans with fewer ``works`` as the winning plan.
2425

2526
The associated plan cache entry is used for subsequent queries with the
2627
same query shape.
@@ -34,7 +35,8 @@ The following diagram illustrates the query planner logic:
3435
Plan Cache Entry State
3536
~~~~~~~~~~~~~~~~~~~~~~
3637

37-
Starting in MongoDB 4.2, the cache entry is associated with a state:
38+
Starting in MongoDB 4.2, each query shape is associated with one of three states
39+
in the cache:
3840

3941
.. list-table::
4042
:header-rows: 1
@@ -49,13 +51,13 @@ Starting in MongoDB 4.2, the cache entry is associated with a state:
4951

5052
No entry for this shape exists in the cache.
5153

52-
For a query, if the cache entry state for a shape is
54+
For a query, if the cache entry state for a query shape is
5355
:ref:`Missing <cache-entry-missing>`:
5456

5557
#. Candidate plans are evaluated and a winning plan is selected.
5658

57-
#. The selected plan is added to the cache in :ref:`Inactive
58-
<cache-entry-inactive>` state with its ``works`` value.
59+
#. The cache creates an entry for the query shape in state :ref:`Inactive
60+
<cache-entry-inactive>` with its ``works`` value.
5961

6062
* - :ref:`Inactive <cache-entry-inactive>`
6163

0 commit comments

Comments
 (0)