Explain can show no rejected plans when multiple plans were considered

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization
    • ALL
    • Hide
      const coll = db.coll;
      coll.drop();
      
      const q = [{$sort : {a : 1}}, {$match : {t : 1}}];
      const docs = [];
      for (let i = 0; i < 100; i++) {
      	docs.push({});
      }
      assert.commandWorked(coll.insert(docs));
      assert.commandWorked(coll.createIndex({a: 1}))
      assert.commandWorked(coll.createIndex({t: 1}))
      jsTestLog(coll.explain().aggregate(q))
      // with featureFlagCostBasedRanker: off, it shows 1 winning plan, 1 rejected
      // with featureFlagCostBasedRanker: on, it shows 1 winning plan, 0 rejected
      
      Show
      const coll = db.coll; coll.drop(); const q = [{$sort : {a : 1}}, {$match : {t : 1}}]; const docs = []; for (let i = 0; i < 100; i++) { docs.push({}); } assert .commandWorked(coll.insert(docs)); assert .commandWorked(coll.createIndex({a: 1})) assert .commandWorked(coll.createIndex({t: 1})) jsTestLog(coll.explain().aggregate(q)) // with featureFlagCostBasedRanker: off, it shows 1 winning plan, 1 rejected // with featureFlagCostBasedRanker: on, it shows 1 winning plan, 0 rejected
    • None
    • None
    • None
    • None
    • None
    • None
    • None

          Assignee:
          Carlos Alonso Pérez
          Reporter:
          Matt Boros
          Votes:
          0 Vote for this issue
          Watchers:
          6 Start watching this issue

            Created:
            Updated:
            Resolved: