-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Index Maintenance
-
None
-
Fully Compatible
-
Query 10 (02/22/16), Query 11 (03/14/16), Query 12 (04/04/16)
A prefix of a non-positional indexed field will now be said to cause the index to be multikey as a result of inserting the generated keys only if the arrElt array value contained multiple elements. This change in the definition of multikey is aligned with SERVER-5580 and will only become user-facing after the changes from SERVER-22726. SERVER-22726 will cause a regular ascending/descending index to be set as multikey (in IndexAccessMethod) based on whether any set in the returned MultikeyPaths is nonempty.
Index: {a: 1} Document: {a: [1]} ⇒ Multikey paths: [] Index: {a: 1} Document: {a: [1, 1]} ⇒ Multikey paths: ["a"] Index: {a: 1} Document: {a: [1, 2]} ⇒ Multikey paths: ["a"]
Note: the creation of v0 indexes has been disallowed since 3.1.9 (see SERVER-17425), so only BtreeKeyGeneratorV1::getKeysImpl() needs to be updated to return the prefixes of the indexed fields that cause the index to be multikey as a result of inserting the generated keys.
- is related to
-
SERVER-5580 covered indexes are improperly applied when arrays do not have multiple values
- Closed