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

Do not require hint() with the full index spec

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Querying
    • 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

        Activity

          People

            Unassigned Unassigned
            antoine Antoine Girbal
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: