Skip to content

DOCS-911 make explain output less terse #533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 9, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 60 additions & 50 deletions source/reference/explain.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ Core Explain Output

.. data:: cursor

Specifies the type of cursor used in the query operation:
:data:`cursor` is a string value that returns the type of cursor
used in the query operation:

- ``BasicCursor`` indicates use of full collection scan.

Expand All @@ -142,53 +143,56 @@ Core Explain Output

.. data:: isMultiKey

A boolean, that specifies if the index used in this query is a
:ref:`multikey index <index-type-multikey>` on a field that holds
an array.
:data:`isMultiKey` is a boolean value that returns ``true`` if the
index used in this query is a :ref:`multikey index
<index-type-multikey>` on a field that holds an array.

.. data:: n

Specifies the number of documents that match the query selection
criteria.
:data:`n` is a number value that returns the number of documents
that match the query selection criteria.

.. data:: nscannedObjects

Specifies the total number of documents scanned during the query.
The :data:`nscannedObjects` may be lower than :data:`nscanned`, such
as if the index is a covered index.
:data:`nscannedObjects` is a number value that returns the total
number of documents scanned during the query. The
:data:`nscannedObjects` may be lower than :data:`nscanned`, such as
if the index is a covered index.

.. data:: nscanned

Specifies the total number of documents or index entries scanned
during the database operation. You want :data:`n` and
:data:`nscanned` to be close in value as possible. The
:data:`nscanned` value may be higher than the
:data:`nscanned` is a number value that returns the total number of
documents or index entries scanned during the database operation.
You want :data:`n` and :data:`nscanned` to be close in value as
possible. The :data:`nscanned` value may be higher than the
:data:`nscannedObjects` value, such as if the index is a covered
index.

.. data:: nscannedObjectsAllPlans

.. versionadded:: 2.2

Specifies the total number of documents scanned for all query plans
during the database operation.
:data:`nscannedObjectsAllPlans` is a number value that returns the
total number of documents scanned for all query plans during the
database operation.

.. data:: nscannedAllPlans

.. versionadded:: 2.2

Specifies the total number of documents or index entries scanned for
all query plans during the database operation.
:data:`nscannedAllPlans` is a number value that returns the total
number of documents or index entries scanned for all query plans
during the database operation.

.. data:: scanAndOrder

.. versionadded:: 2.2

:data:`scanAndOrder` is a boolean value that returns ``true`` when
the query cannot use the index for returning sorted results.
the query **cannot** use the index for returning sorted results.

When ``false`` MongoDB must sort documents retrieving the documents
using either an index cursor or by cursor that scans the entire
When ``true``, MongoDB must sort the documents after it retrieves
them from either an index cursor or a cursor that scans the entire
collection.

.. data:: indexOnly
Expand All @@ -200,24 +204,25 @@ Core Explain Output

.. data:: nYields

Specifies the number of times this query yielded the read lock to
allow waiting writes execute.
:data:`nYields` is a number value that returns the number of times
this query yielded the read lock to allow waiting writes execute.

.. data:: nChunkSkips

Specifies the number of documents skipped because of active chunk
migrations in a sharded system. Typically this will be zero. A
number greater than zero is ok, but indicates a little bit of
inefficiency.
:data:`nChunkSkips` is a number value that returns the number of
documents skipped because of active chunk migrations in a sharded
system. Typically this will be zero. A number greater than zero is
ok, but indicates a little bit of inefficiency.

.. data:: millis

Specifies the number of milliseconds to complete the query.
:data:`millis` is a number value that returns the time in
milliseconds to complete the query.

.. data:: indexBounds

Specifies the lower and upper index key bounds. This field
resembles one of the following:
:data:`indexBounds` is a document that contains the lower and upper
index key bounds. This field resembles one of the following:

.. code-block:: javascript

Expand All @@ -234,24 +239,25 @@ Core Explain Output

.. data:: allPlans

Specifies the list of plans the query optimizer runs in order to
select the index for the query. Displays only when the ``<verbose>``
parameter to :method:`explain() <cursor.explain()>` is
``true`` or ``1``.
:data:`allPlans` is an array value that returns the list of plans
the query optimizer runs in order to select the index for the query.
Displays only when the ``<verbose>`` parameter to :method:`explain()
<cursor.explain()>` is ``true`` or ``1``.

.. data:: oldPlan

.. versionadded:: 2.2

Specifies the previous plan selected by the query optimizer for the
query. Displays only when the ``<verbose>`` parameter to
:method:`explain() <cursor.explain()>` is ``true`` or ``1``.
:data:`oldPlan` is a document value that returns the previous plan
selected by the query optimizer for the query. Displays only when
the ``<verbose>`` parameter to :method:`explain()
<cursor.explain()>` is ``true`` or ``1``.

.. data:: server

.. versionadded:: 2.2

Specifies the MongoDB server.
:data:`server` is a string value that returns the MongoDB server.

.. _explain-output-field-or-clauses:

Expand All @@ -260,10 +266,10 @@ Core Explain Output

.. data:: clauses

Contains the :ref:`explain-output-fields-core` information for each
clause of the :operator:`$or` expression. :data:`classes` is only
included when the clauses in the :operator:`$or` expression use
indexes.
:data:`clauses` is an array value that returns the
:ref:`explain-output-fields-core` information for each clause of the
:operator:`$or` expression. :data:`classes` is only included when
the clauses in the :operator:`$or` expression use indexes.

.. _explain-output-fields-sharded-collection:

Expand All @@ -272,31 +278,35 @@ Sharded Collections Output

.. data:: clusteredType

Describes the access pattern for shards. The value is:
:data:`clusteredType` is a string value that returns the access
pattern for shards. The value is:

- ``ParallelSort``, if the :program:`mongos` queries shards in parallel.

- ``SerialServer``, if the :program:`mongos` queries shards sequentially.

.. data:: shards

Specifies the shards accessed during the query and individual
:ref:`explain-output-fields-core` for each shard.
:data:`shards` is a document value that contains the shards accessed
during the query and individual :ref:`explain-output-fields-core`
for each shard.

.. data:: millisShardTotal

Specifies the total time in milliseconds for the query to run on the
shards.
:data:`millisShardTotal` is a number value that returns the total
time in milliseconds for the query to run on the shards.

.. data:: millisShardAvg

Specifies the average time in millisecond for the query to run on
each shard.
:data:`millisShardAvt` is a number value that returns the average
time in millisecond for the query to run on each shard.

.. data:: numQueries

Specifies the total number of queries executed.
:data:`numQueries` is a number value that returns the total number
of queries executed.

.. data:: numShards

Specifies the total number of shards queried.
:data:`numShards` is a number value that returns the total number of
shards queried.
8 changes: 4 additions & 4 deletions source/reference/method/cursor.explain.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ cursor.explain()

- :operator:`$explain`

- :wiki:`Optimization` wiki page for information regarding
optimization strategies.
- :doc:`/applications/optimization` page for information
regarding optimization strategies.

- :wiki:`Database Profiler` wiki page for information regarding
optimization strategies.
- :doc:`/tutorial/manage-the-database-profiler` tutorial for
information regarding the database profile.

- :doc:`Current Operation Reporting </reference/current-op>`
8 changes: 4 additions & 4 deletions source/reference/operator/explain.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ $explain

- :method:`cursor.explain()`

- :wiki:`Optimization` wiki page for information regarding
optimization strategies.
- :doc:`/applications/optimization` page for information
regarding optimization strategies.

- :wiki:`Database Profiler` wiki page for information regarding
optimization strategies.
- :doc:`/tutorial/manage-the-database-profiler` tutorial for
information regarding the database profile.

- :doc:`Current Operation Reporting </reference/current-op>`