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

distinct doesn't use index to distinct multikey dotted fields

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.4.10, 2.6.3, 3.0.14, 3.2.10, 3.5.13
    • Fix Version/s: 4.1.10
    • Component/s: Indexing
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.0, v3.6
    • Sprint:
      Query 2019-03-11, Query 2019-03-25, Query 2019-04-08
    • Case:

      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

          Issue Links

            Activity

              People

              Assignee:
              ian.boros Ian Boros
              Reporter:
              asya Asya Kamsky
              Participants:
              Votes:
              17 Vote for this issue
              Watchers:
              28 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: