File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,29 @@ Index Intersection
10
10
:depth: 1
11
11
:class: singlecol
12
12
13
- .. versionadded:: 2.6
13
+ .. important::
14
+
15
+ This page documents cases where the :doc:`query optimizer
16
+ </core/query-plans>` **may** be able to use index intersection.
17
+
18
+ In practice, the :doc:`query optimizer </core/query-plans>` rarely
19
+ selects plans that use index intersection.
20
+
21
+ Hash-based index intersection is disabled by default and sort-based
22
+ index intersection is disfavored in plan selection. The optimizer
23
+ behaves in this fashion in order to prevent bad plan selection.
24
+
25
+ Schema designs should not rely on index intersection. Instead,
26
+ :doc:`compound indexes </core/index-compound>` should be used.
27
+
28
+ Future improvements to the query optimizer may allow the system to
29
+ better identify cases where an index intersection plan would be
30
+ beneficial.
14
31
15
32
MongoDB can use the intersection of multiple indexes to fulfill
16
- queries. [#previous-versions]_ In general, each index intersection
17
- involves two indexes; however, MongoDB can employ multiple/nested index
18
- intersections to resolve a query.
33
+ queries. In general, each index intersection involves two indexes;
34
+ however, MongoDB can employ multiple/nested index intersections to
35
+ resolve a query.
19
36
20
37
To illustrate index intersection, consider a collection ``orders`` that
21
38
has the following indexes:
You can’t perform that action at this time.
0 commit comments