[SERVER-23115] Include the prefixes of the indexed fields that cause index to be multikey in explain output Created: 14/Mar/16  Updated: 06/Jun/16  Resolved: 17/May/16

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 3.3.8

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

Backwards Compatibility: Fully Compatible
Sprint: Query 12 (04/04/16), Query 13 (04/22/16), Query 14 (05/13/16)
Participants:

 Description   

Include the path-level multikey information to the explain output as a field called "multiKeyPaths". The value associated with the "multiKeyPaths" field is an object with keys equal to those in the index key pattern and values equal to an array of strings corresponding to paths that cause the index to be multikey.

For example, with the index {a: 1, 'b.c': 1, 'b.d': 1} where the paths "b" and "b.c" cause the index to be multikey (e.g. from inserting the document {a: 1, b: [{c: ["w", "x"], d: 3}, {c: ["y", "z"], d: 4}]}), we'd have

{
    "stage" : "IXSCAN",
    "keyPattern" : {
        "a" : 1,
        "b.c" : 1,
        "b.d" : 1
    },
    "indexName" : "a_1_b.c_1_b.d_1",
    "isMultiKey" : true,
    "multiKeyPaths" : {
        "a" : [ ],
        "b.c" : [
            "b",
            "b.c"
        ],
        "b.d" : [
            "b"
        ]
    },
    ...
}


Note: The "multiKeyPaths" field is still included in the explain output when isMultiKey=false as a way to indicate that the index supports tracking path-level multikey information.



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

Author:

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

Message: SERVER-23115 Include path-level multikey information in explain output.

Applies to plan stages that use an index:

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