Skip to content

Commit a0e0a6a

Browse files
DOCSP-33154 Make covered query info discoverable (#4762) (#4934)
* Summarized covered query benefits. Opted not to use an include * Removed covered query info from wildcard indexes
1 parent a2c7bdf commit a0e0a6a

File tree

7 files changed

+35
-2
lines changed

7 files changed

+35
-2
lines changed

source/core/indexes/index-types/index-compound.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ Compound Indexes
1414

1515
.. include:: /includes/indexes/fact-compound-index-intro.rst
1616

17+
Indexing commonly queried fields increases the
18+
likelihood of :ref:`covered queries <indexes-covered-queries>`. A
19+
covered query is a query that can be satisfied entirely using an index
20+
and does not have to examine any documents, leading to greatly improved performance.
21+
1722
To create a compound index, use the following prototype:
1823

1924
.. include:: /includes/indexes/code-examples/create-compound-index.rst
@@ -38,6 +43,11 @@ inventory items by name and quantity to determine which items are low
3843
stock. You can create a compound index on both the ``item`` and
3944
``quantity`` fields to improve query performance.
4045

46+
A compound index on commonly queried fields increases the chances of
47+
:ref:`covering <indexes-covered-queries>` those queries. Covered queries
48+
are queries that can be satisfied entirely using an index, without
49+
examining any documents. This optimizes query performance.
50+
4151
Get Started
4252
-----------
4353

source/core/indexes/index-types/index-compound/create-compound-index.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ Create a Compound Index
1515
**Compound indexes** are indexes that contain references to multiple
1616
fields. Compound indexes improve performance for queries on exactly the
1717
fields in the index or fields in the :ref:`index prefix
18-
<compound-index-prefix>`.
18+
<compound-index-prefix>`. Indexing commonly queried fields increases the
19+
chances of :ref:`covering <indexes-covered-queries>` those queries,
20+
meaning MongoDB can satisfy the query entirely with the index,
21+
without examining documents.
1922

2023
To create a compound index, use the
2124
:method:`db.collection.createIndex()` method:

source/core/indexes/index-types/index-geospatial.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ on the ``location`` field. After creating the index, you can query
5151
using the :query:`$near` operator to return a list of nearby stations,
5252
sorted from nearest to farthest.
5353

54+
Indexing commonly queried fields increases the chances of :ref:`covering <indexes-covered-queries>` those queries. Covered queries
55+
are queries that can be satisfied entirely using an index, without
56+
examining any documents. This optimizes query performance.
57+
5458
Get Started
5559
-----------
5660

source/core/indexes/index-types/index-multikey.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ Use Cases
4848
If your application frequently queries a field that contains an array
4949
value, a multikey index improves performance for those queries.
5050

51+
Indexing commonly queried fields increases the chances of :ref:`covering <indexes-covered-queries>` those queries. Covered queries
52+
are queries that can be satisfied entirely using an index, without
53+
examining any documents. This optimizes query performance.
54+
5155
For example, documents in a ``students`` collection contain a
5256
``test_scores`` field: an array of test scores a student received
5357
throughout the semester. You regularly update a list of top students:

source/core/indexes/index-types/index-single.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ human resources department often needs to look up employees by employee
6666
ID. You can create an index on the employee ID field to improve the
6767
performance of that query.
6868

69+
Indexing commonly queried fields increases the chances of :ref:`covering
70+
<indexes-covered-queries>` those queries. Covered queries are queries
71+
that can be satisfied entirely using an index, without examining any
72+
documents. This optimizes query performance.
73+
6974
Get Started
7075
-----------
7176

source/core/indexes/index-types/index-single/create-single-field-index.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ Create an Index on a Single Field
1313
:class: singlecol
1414

1515
You can create an index on a single field to improve performance for
16-
queries on that field.
16+
queries on that field. Indexing commonly queried fields increases the
17+
chances of :ref:`covering <indexes-covered-queries>` those queries,
18+
meaning MongoDB can satisfy the query entirely with the index,
19+
without examining documents.
1720

1821
To create a single-field index, use the
1922
:method:`db.collection.createIndex()` method:

source/core/indexes/index-types/index-text.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ searching for specific words or phrases within string content.
2222
A collection can only have **one** text index, but that index can cover
2323
multiple fields.
2424

25+
Indexing commonly queried fields increases the chances of :ref:`covering <indexes-covered-queries>` those queries. Covered queries
26+
are queries that can be satisfied entirely using an index, without
27+
examining any documents. This optimizes query performance.
28+
2529
To create a text index, use the following prototype:
2630

2731
.. include:: /includes/indexes/code-examples/create-text-index.rst

0 commit comments

Comments
 (0)