[SERVER-10340] Do not require hint() with the full index spec Created: 25/Jul/13  Updated: 27/Oct/15  Resolved: 27/Oct/15

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Antoine Girbal Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-12584 Query: planner returns bad hint error... Closed
Participants:

 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


Generated at Thu Feb 08 03:22:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.