-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Currently PQS index hints and indexFilters are handled in the QueryPlannerParams module (ref), but command hints are handled separately in the QueryPlanner::plan() method (ref).
While this is due to historical reasons and difference in semantics (command hint is forceful, PQS is suggestive (just filters the index list)), it would be great to simplify the code and remove hintedIndexBson usage from the planner code.
We could achieve this by doing same filtering as we do with PQS/indexFilters, but instead (introduce and) set a different QueryPlannerParams.OPTIONS tag, which would indicate that the index MUST be used (and can not fallback to multiplan without it as we do with the PQS)