Timeseries metadata $project + $sort incorrectly pushes $sort before bucket unpack

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • 200
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

              Assignee:
              Will Buerger
              Reporter:
              Will Buerger
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: