-
Type:
Bug
-
Resolution: Works as Designed
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Integration
-
ALL
-
-
QI 2023-09-04
-
None
-
None
-
None
-
None
-
None
-
None
-
None
In a timeseries pipeline, when we first have a $group stage on the $meta field and an accumulator on the $min as the first stage, and then have a $match on the _id as the second stage, the pipeline is rewritten to absorb the $match into the index scan and leave the $group stage.
In essence, the stages $_unpack -> $group(_id=$meta, min=$meta) -> $match (_id=1) gets reordered to $IXSCAN (with $meta=1) -> $group(_id=$meta, min=$meta)