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

Compound index with multi key doesn't find best solution

    • Type: Icon: Bug Bug
    • Resolution: Incomplete
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Index Maintenance
    • Labels:
      None
    • ALL

      If I have an index of

      {a:1,b:1,c:1}

      and query a=AA, b=BB, N1<c<N2, the index bounds to exactly that: a is bounded by AA, b is bounded by BB, and c is bounded by N1 and N2.

      BUT if instead the index is

      {a:1, b.x:1, c:1}

      and query is a=AA, b.x=BB, N1<c<N2, the index only bounds a by AA, b.x by BB, and C by N1... requiring scanning to hit N2.

            Assignee:
            kelsey.schubert@mongodb.com Kelsey Schubert
            Reporter:
            hbell@bluecanyontech.com Hayle Bell
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: