$match stage with $expr does not always need to make a 'MatchExpression'

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • QE 2021-11-15, QE 2021-11-29, QE 2021-12-27, QE 2022-01-10, QE 2022-04-04, QE 2022-02-07, QE 2022-02-21, QE 2022-03-07, QE 2022-03-21, QE 2022-01-24
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      If a $match (with $expr) stage isn't a source stage after the rewrite, we could avoid building a 'MatchExpression' for the query inside the $match and directly evaluate the aggregate expression inside DocumentSourceMatch stage itself. The main advantage of doing this is that we avoid unnecessary transformation of Document -> BSONObj -> Document, that happens in DocumentSourceMatch stage for each document.

            Assignee:
            [DO NOT USE] Backlog - Query Execution
            Reporter:
            Arun Banala
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: