Skip to content

Commit 849ed95

Browse files
authored
DOCS-15714 Adding consideration of clustered index scan in multi planning (#4796)
* DOCS-15714 adding behavior on clustered index scans * DOCS-15714 adding behavior on clustered index scans * DOCS-15714 adding behavior on clustered index scans * DOCS-15714 copy edits * DOCS-15714 copy edits * DOCS-15714 adding active voice * DOCS-15714 fixing bullet * DOCS-15714 fixing plurals * DOCS-15714 more active voice * DOCS-15714 removed seocnd note bullet * DOCS-15714 removed seocnd note bullet * DOCS-15714 removed seocnd note bullet * DOCS-15714 removing colon * DOCS-15714 present tense * DOCS-15714 copy edits round 2 * DOCS-15714 changing prior versioning text to past tense
1 parent b6be51f commit 849ed95

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

source/core/clustered-collections.txt

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ Overview
1919

2020
.. include:: /includes/clustered-collections-introduction.rst
2121

22+
.. important:: Backward-Incompatible Feature
23+
24+
You must drop clustered collections before you can downgrade to
25+
a version of MongoDB earlier than 5.3.
26+
2227
Benefits
2328
--------
2429

@@ -81,10 +86,18 @@ from secondary indexes:
8186
collection size returned by the :dbcommand:`collStats` command
8287
includes the clustered index size.
8388

84-
.. important:: Backward-Incompatible Feature
89+
Starting in MongoDB 6.2, if a usable clustered index exists, the MongoDB
90+
query planner evaluates the clustered index against secondary indexes in
91+
the query planning process. When a query uses a clustered index, MongoDB
92+
performs a :term:`bounded collection scan`.
8593

86-
You must drop clustered collections before you can downgrade to
87-
a version of MongoDB earlier than 5.3.
94+
Prior to MongoDB 6.2, if a :term:`secondary index <secondary index>`
95+
existed on a clustered collection and the secondary index was usable by
96+
your query, the query planner selected the secondary index instead of the
97+
clustered index by default. In MongoDB 6.1 and prior, to use the
98+
clustered index, you must provide a hint because the :doc:`query
99+
optimizer </core/query-plans>` does not automatically select the
100+
clustered index.
88101

89102
Limitations
90103
-----------
@@ -102,22 +115,6 @@ Clustered collection limitations:
102115
- Export collection data with :binary:`~bin.mongodump` and import the
103116
data into another collection with :binary:`~bin.mongorestore`.
104117

105-
- By default, if a :term:`secondary index <secondary index>` exists on
106-
a clustered collection and the secondary index is usable by your
107-
query, the secondary index is selected instead of the clustered
108-
index.
109-
110-
- You must provide a hint to use the clustered index because it
111-
is not automatically selected by the :doc:`query optimizer
112-
</core/query-plans>`.
113-
114-
- The :ref:`clustered index <db.createCollection.clusteredIndex>` is
115-
not automatically used by the query optimizer if a usable secondary
116-
index exists.
117-
118-
- When a query uses a clustered index, it will perform a
119-
:term:`bounded collection scan`.
120-
121118
- The clustered index key must be on the ``_id`` field.
122119

123120
- You cannot hide a clustered index. See :doc:`Hidden indexes

0 commit comments

Comments
 (0)