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

Make the keyPattern field in express plan explains more easily parseable

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Execution

      The Compass team is working on COMPASS-7794 and ran into some challenges processing the explain output of express plans. In particular, the keyPattern field has a different format for express plans that is proving difficult to parse. For express plans, we see the following output:

                      {
                              "stage" : "EXPRESS_IXSCAN",
                              "keyPattern" : "{ _id: 1 }",
                              ...
                      }, 

      and

                      {
                              "stage" : "EXPRESS_IXSCAN",
                              "keyPattern" : "{ a: 1 }",
                              ...
                      }, 

      whereas regular index scans result in the following:

                                      "stage" : "IXSCAN",
                                      "keyPattern" : {
                                              "a" : 1
                                      }, 

       

      The ask is to make the keyPattern field more easily parseable, either by wrapping the field names in quotes:

      "keyPattern": "{ \"a\": 1 }", 

      or by serializing the pattern as an object as we do in non-express explain output.

            Assignee:
            Unassigned Unassigned
            Reporter:
            hana.pearlman@mongodb.com Hana Pearlman
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: