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

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

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

      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 Unassigned
            Reporter:
            matt.boros@mongodb.com Matt Boros
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated: