Always choose covering plan if it satisfies superset of predicates compared to other plans

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In one of the high value workloads we multiplan a few index + fetch plans along with a covering index plan that satisfies a superset of the predicates covered in the non-covering plans.

      db.c.insert({a: 1, b: 1})
      db.c.createIndex({a: 1})
      db.c.createIndex({a: 1, b: 1})
      db.c.explain().aggregate([{$match: {a: 1, b: {$ne: null}}}, {$count: "c"}]) 

      We consider {a: 1} and {a: 1, b: 1} even though the covering {a: 1, b:1} will always be more efficient.

              Assignee:
              Unassigned
              Reporter:
              Matt Boros
              Votes:
              0 Vote for this issue
              Watchers:
              13 Start watching this issue

                Created:
                Updated: