@@ -19,6 +19,11 @@ Overview
19
19
20
20
.. include:: /includes/clustered-collections-introduction.rst
21
21
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
+
22
27
Benefits
23
28
--------
24
29
@@ -81,10 +86,18 @@ from secondary indexes:
81
86
collection size returned by the :dbcommand:`collStats` command
82
87
includes the clustered index size.
83
88
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`.
85
93
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.
88
101
89
102
Limitations
90
103
-----------
@@ -102,22 +115,6 @@ Clustered collection limitations:
102
115
- Export collection data with :binary:`~bin.mongodump` and import the
103
116
data into another collection with :binary:`~bin.mongorestore`.
104
117
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
-
121
118
- The clustered index key must be on the ``_id`` field.
122
119
123
120
- You cannot hide a clustered index. See :doc:`Hidden indexes
0 commit comments