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

execStats in system.profile reports winning plan and rejected plans

    • Fully Compatible
    • ALL
    • Hide
      db.setProfilingLevel(0);
      db.system.profile.drop();
      db.c.drop();
      db.c.ensureIndex({a: 1});
      db.c.ensureIndex({b: 1});
      db.c.insert({a: 1, b: 1});
      db.setProfilingLevel(2);
      db.c.find({a: 1, b: 1}).itcount();
      db.setProfilingLevel(2);
      db.system.profile.find().pretty();
      
      Show
      db.setProfilingLevel(0); db.system.profile.drop(); db.c.drop(); db.c.ensureIndex({a: 1}); db.c.ensureIndex({b: 1}); db.c.insert({a: 1, b: 1}); db.setProfilingLevel(2); db.c.find({a: 1, b: 1}).itcount(); db.setProfilingLevel(2); db.system.profile.find().pretty();
    • Query 10 (02/22/16), Query 11 (03/14/16)

      When profiling is enabled, find operations will add a field called execStats containing some information about the execution of the query plan. In 2.6.x and 3.0.x versions, this contained information about the winning plan only. If the query used the multiplan path, information about the rejected plans was rejected.

      This behavior changed in 3.2.0 as a result of 5aefcdd under SERVER-20111. The profile entries now can contain execStats with a MULTI_PLAN stage. All children of the MULTI_PLAN stage are reported, regardless of which child represents the winning plan.

            Assignee:
            james.wahlin@mongodb.com James Wahlin
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: