No "executionStats" with explain mode for aggregate

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 4.0.1
    • Component/s: Aggregation Framework
    • None
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      As describe here https://jira.mongodb.org/browse/SERVER-19758, the functionnality  "executionStats" with explain has been added since Mongo version 3.5.5.

      With Mongo version 4.0.1, "executionStats" is not returned with explain mode.

      Unable to find source-code formatter for language: javascript. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
       db.version();
       db.c.drop();
       for (let i = 0; i < 10; i++) { db.c.insert({_id: i, a: 1, b: i}); }
        
       db.c.createIndex({a: 1});
       db.c.createIndex({b: 1});
       
       /* method 1 */ 
       db.c.explain("executionStats").aggregate([{$match: {a: 1, b: {$gt: 3}}}]);
      
       /* method 2 */ 
       db.c.aggregate(
        [{$match: {a: 1, b: {$gt: 3}}}],
        { explain: true }
      )
      

      Result method 1 :
       

      {
          "stages" : [ 
              {
                  "$cursor" : {
                      "query" : {
                          "a" : 1.0,
                          "b" : {
                              "$gt" : 3.0
                          }
                      },
                      "queryPlanner" : {
                          "plannerVersion" : 1,
                          "namespace" : "test.c",
                          "indexFilterSet" : false,
                          "parsedQuery" : {
                              "$and" : [ 
                                  {
                                      "a" : {
                                          "$eq" : 1.0
                                      }
                                  }, 
                                  {
                                      "b" : {
                                          "$gt" : 3.0
                                      }
                                  }
                              ]
                          },
                          "winningPlan" : {
                              "stage" : "CACHED_PLAN",
                              "inputStage" : {
                                  "stage" : "FETCH",
                                  "filter" : {
                                      "a" : {
                                          "$eq" : 1.0
                                      }
                                  },
                                  "inputStage" : {
                                      "stage" : "IXSCAN",
                                      "keyPattern" : {
                                          "b" : 1.0
                                      },
                                      "indexName" : "b_1",
                                      "isMultiKey" : false,
                                      "multiKeyPaths" : {
                                          "b" : []
                                      },
                                      "isUnique" : false,
                                      "isSparse" : false,
                                      "isPartial" : false,
                                      "indexVersion" : 1,
                                      "direction" : "forward",
                                      "indexBounds" : {
                                          "b" : [ 
                                              "(3.0, inf.0]"
                                          ]
                                      }
                                  }
                              }
                          },
                          "rejectedPlans" : []
                      }
                  }
              }
          ],
          "ok" : 1.0
      }
      

            Assignee:
            Nick Brewer (Inactive)
            Reporter:
            dorothee
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: