[SERVER-58957] $match stage with $expr does not always need to make a 'MatchExpression' Created: 29/Jul/21 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Arun Banala | Assignee: | Backlog - Query Execution |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Execution
|
| Sprint: | 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 |
| Participants: |
| 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. |