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

explain() doesn't display plan information if chosen query plan generates error

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Diagnostics, Querying

      When running an explain() against a query in which the chosen query plan generates an error, the explain output does not include any plan information. In this case, the explain output should indicate the chosen plan and the other plans considered.

      Affects all released versions.

      Reproduce with the following:

      > x = ''
      > for (i=0;i<1000;i++){x+='i'}
      iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
      > for (i=0;i<32*1024;i++){db.foo.insert({x:x}) }
      > db.foo.find().sort({x:1}).explain()
      Thu May 29 14:18:39.603 error: {
      	"$err" : "Runner error: Overflow sort stage buffered data usage of 33555426 bytes exceeds internal limit of 33554432 bytes",
      	"code" : 17144
      } at src/mongo/shell/query.js:128
      >
      

      Note that, as of MongoDB 2.6, basic plan information is logged in case of an error:

      2014-05-29T14:24:33.476-0400 [conn1] ERROR: Runner error, stats:
      { "type" : "SORT",
        "works" : 32330,
        "yields" : 252,
        "unyields" : 252,
        "invalidates" : 0,
        "advanced" : 0,
        "needTime" : 32328,
        "needFetch" : 0,
        "isEOF" : 0,
        "forcedFetches" : 0,
        "memUsage" : 33555426,
        "memLimit" : 33554432,
        "children" : [
          { "type" : "COLLSCAN",
            "works" : 32328,
            "yields" : 252,
            "unyields" : 252,
            "invalidates" : 0,
            "advanced" : 32327,
            "needTime" : 1,
            "needFetch" : 0,
            "isEOF" : 0,
            "docsTested" : 32327,
            "children" : [] } ] }
      2014-05-29T14:24:33.497-0400 [conn1] assertion 17144 Runner error: Overflow sort stage buffered data usage of 33555426 bytes exceeds internal limit of 33554432 bytes ns:test.foo query:{ query: {}, orderby: { x: 1.0 }, $explain: true }
      

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            rassi J Rassi
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: