SERVER-125570ClosedFixed

Pushdown $match on keyHash into $queryStats stage to avoid full store scan

h2. Overview The {{$queryStats}} aggregation stage currently performs a full linear scan of the in-memory query stats store on every invocation, regardless of any downstream {{$match}} predicates. Pipelines of the form re-serialize the representative shape for every entry in the store and then discard most of them via the filter — wasted CPU proportional to store size, not result size. h2. Background Production clusters with many distinct query shapes have been observed running this pi

Affected Versions
Versions known to exhibit this issue

No affected versions recorded.

Fixed Versions
Versions that include the fix
9.1.0-rc0
Components
Server components related to this issue

No components specified.

Labels
Tags and classification
dino-query-stats