Skip to content

Commit 2283ce5

Browse files
authored
add details about what executionTimeMillis includes (#5863)
* add details about what executionTimeMillis includes * review suggestions * Address review suggestions * remove antiquated info
1 parent 46d1301 commit 2283ce5

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

source/reference/explain-results.txt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Explain Results
1212
:depth: 2
1313
:class: singlecol
1414

15-
To return information on query plans and execution statistics of the
16-
query plans, MongoDB provides:
15+
To return information on :ref:`query plans <query-plans-query-optimization>` and
16+
execution statistics of the query plans, MongoDB provides:
1717

1818
- the :method:`db.collection.explain()` method,
1919

@@ -565,9 +565,17 @@ representative. Your output may differ significantly.
565565
.. data:: explain.executionStats.executionTimeMillis
566566

567567
Total time in milliseconds required for query plan selection and
568-
query execution. :data:`explain.executionStats.executionTimeMillis` corresponds
569-
to the ``millis`` field returned by ``cursor.explain()`` in
570-
earlier versions of MongoDB.
568+
query execution. It includes the time it takes to run the trial phase
569+
part of the plan selection process, but does not include the network time
570+
to transmit the data back to the client.
571+
572+
The time reported by ``explain.executionStats.executionTimeMillis`` is
573+
not necessarily representative of actual query time. During steady
574+
state operations (when the query plan is cached), or when using
575+
:method:`cursor.hint()` with ``cursor.explain()``, MongoDB bypasses the
576+
plan selection process, resulting in a faster actual time, leading to
577+
a lower ``explain.executionStats.executionTimeMillis`` value.
578+
571579

572580
.. data:: explain.executionStats.totalKeysExamined
573581

0 commit comments

Comments
 (0)