-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Execution
indexHint is an idl type defined in hint.idl
Currently it accepts BSONObj or String as valid BSON types and is represented as a BSONObj in code (by converting an IndexName represented in String into a BSONObj).
When working with hint type, it not always clear what exactly does the hint represent, an IndexName, IndexKeyPattern, or a NaturalOrderHint.
As part of SERVER-77075 query settings were defined in the idl, together with the index hint spec and the new definition of the (new) index hint type.
New IndexHint class is represented as a class wrapping
stdx::variant<IndexKeyPattern, IndexName, NaturalOrderHint> _hint;
which documents all possible index hint types.
As part of this ticket we would:
- remove the old index hint definition in idl
- replace the old usage with the new definition (e.g. in find command)
- remove the no longer needed methods like isHintIndexKey() and hasInvalidNaturalParam()
- refactor the findIndexesByHint() (including early return once index is found for the given hint)
- refactor various methods in query_planner.cpp including hintMatchesNameOrPattern()
- refactor query_shape::extractHintShape()
- is related to
-
SERVER-68922 $natural parser should be stricter (reject NaN, etc)
- Closed
-
SERVER-77075 Define query settings in idl
- Closed