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

distinct doesn't use index to distinct multikey dotted fields

    XMLWordPrintableJSON

Details

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

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: