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

Do not require hint() with the full index spec

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Querying
    • Labels:
      None

      Description

      right now you have to specify the exact name of the index for the hint to work. I'm finding a lot of cases where Mongo does not pick the right index when a sort is used. Using hint I need to specify the exact compound index and it make the code brittle because if the index is not there as-is then those queries will just fail. Hinting would be much more usable if it allows to match a prefix.
      For example:

      • index { tenantId, userId, time, coveredField }
      • hint on { tenantId, userId }

        should just match that index

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              antoine Antoine Girbal
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: