-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Integration
-
200
This example pipeline has different result ordering (by the $sort) with optimizations on vs. off, where "tag" is the meta field:
[{"$project": {"tag.assistant": 0}}, {"$sort": {"tag": 1}}]
With optimizations on, the $sort is pushed before the bucket unpack, even though the $sort is dependent on the $project since it modifies the meta field.
In the timeseries rewrite logic, this query has haveComputedMetaField false, meaning it is allowed to proceed with the sort reorder (createMetadataSortForReorder()), even though the meta field is modified before $sort.