-
Type:
Investigation
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
Developer Tools
Original Downstream Change Summary
This ticket optimizes some $queryStats pipelines. If users run a pipeline such as:
[
{ $queryStats: {} },
{ $match: { keyHash:
} }
]
(or filter by a single keyHash), the $match can be pushed into $queryStats. Instead of scanning the entire in-memory query stats store and filtering afterward, the stage uses a secondary index to look up the matching entries. With explain enabled, the $queryStats stage includes a keyHashLookupLocations array containing the keyHash values used for the lookup:
"$queryStats" :
{ "keyHashLookupLocations" : [<keyHash1>, <keyHash2>] }The returned $queryStats documents remain unchanged. SERVER-125570
Description of Linked Ticket
null
- depends on
-
SERVER-135371 Enable optimization query knob
-
- Closed
-