Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-58957

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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • 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

    Description

      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.

      Attachments

        Activity

          People

            backlog-query-execution Backlog - Query Execution
            arun.banala@mongodb.com Arun Banala
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: