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

distinct doesn't use index to distinct multikey dotted fields

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.10
    • Affects Version/s: 2.4.10, 2.6.3, 3.0.14, 3.2.10, 3.5.13
    • Component/s: Index Maintenance
    • Fully Compatible
    • ALL
    • v4.0, v3.6
    • Query 2019-03-11, Query 2019-03-25, Query 2019-04-08

      Had a compound index on

      { "lineitems.returnflag":1, "lineitems.linestatus":1 }
      

      where lineitems is an array.

      Did db.orders.distinct("lineitems.returnflag") which caused a collection scan.

      Non-multikey correctly used the index.

            Assignee:
            ian.boros@mongodb.com Ian Boros
            Reporter:
            asya.kamsky@mongodb.com Asya Kamsky
            Votes:
            17 Vote for this issue
            Watchers:
            27 Start watching this issue

              Created:
              Updated:
              Resolved: