[SERVER-22400] Extend BtreeKeyGenerator::getKeys() to return which indexed paths are multikey Created: 01/Feb/16  Updated: 14/Apr/16  Resolved: 17/Mar/16

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: None
Fix Version/s: 3.3.4

Type: Task Priority: Major - P3
Reporter: David Storch Assignee: Max Hirschhorn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-5580 covered indexes are improperly applie... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query 10 (02/22/16), Query 11 (03/14/16), Query 12 (04/04/16)
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 17/Mar/16 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-22400 Compute multikey paths in BtreeKeyGeneratorV1::getKeys().

Propagates information about the prefixes of the indexed fields that
cause the index to be multikey as a result of inserting the generated
keys.
Branch: master
https://github.com/mongodb/mongo/commit/0654b0f626fd4a2f1f8842fa41a98704aada6e01

Generated at Thu Feb 08 04:00:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.