-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Execution
As part of SERVER-79181 QuerySettings are now applied to the query, before planning is performed.
applyQuerySettings() looks at the index hints for the given collection and then removes all of the indexes, which are not present in the settings.indexHints.allowedIndexes list.
Currently, this is done as a for loop over all of the indexes and an additional for loop over all of the hints, however, this could be speed up by doing a hash set lookup into set of all allowed index names and set of allowed index patterns. This approach has already been employed by index filters mechanism (https://github.com/mongodb/mongo/blob/965ec692dedf1f1bebad2c28ba54d9f21a9d25ea/src/mongo/db/query/get_executor.cpp#L207)
This way we would speed up the QuerySettings application on the hot path
First we need to profile to check how much time is spent performing the linear scan and then decide whether or not it is worth utilizing more sophisticated data structures for faster set intersection
- is related to
-
SERVER-80931 Cache QuerySettings hash, such that it does not have to be recomputed for plan cache lookup
- Backlog
-
SERVER-79181 Apply QuerySettings for find commands
- Closed