[SERVER-72038] Better projection analysis for $replace(With|Root) Created: 12/Dec/22 Updated: 31/Oct/23 |
|
| Status: | Open |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Charlie Swanson | Assignee: | Backlog - Query Optimization |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query Optimization
|
||||||||
| Participants: | |||||||||
| Description |
|
I'm thinking of a query like so:
SERVER-72037 describes the work to push the $match before the $replaceWith. But even if that is complete, we would seem to stop our projection/dependency analysis at the $replaceWith stage there and miss that the query only needs "x.y", not all of "x". If "x" had many sub-fields, this could be a dramatic savings. |