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

remove repeat contain index from the relevant candidate indexes, this can avoid some useless calculations

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization

      remove repeat contain index from the relevant candidate indexes, this can avoid some useless calculations.
      for example:
         {a:1, b:1} contain {a:1}, so we can remove index {a:1} from the candidates
         {a:"hashed", b:1} contain {a:"hashed"}, so we can remove index {a:"hahsed"} from the candidates

       {a:1, b:1} is better than {a:1},because both cases are satisfied for db.collection.find({a:xx}) 
          and db.collection.find({a:xx,b:xx})

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            1147952115@qq.com y yz
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: