@@ -20,7 +20,8 @@ For a query, the MongoDB query optimizer chooses and caches the most
2020efficient query plan given the available indexes. The evaluation of the
2121most 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
2526The associated plan cache entry is used for subsequent queries with the
2627same query shape.
@@ -34,7 +35,8 @@ The following diagram illustrates the query planner logic:
3435Plan 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