Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-22400

Extend BtreeKeyGenerator::getKeys() to return which indexed paths are multikey

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.4
    • 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.

            Assignee:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: