[SERVER-25897] Add a priming stage to Pipeline execution to help determine if further optimization can happen. Created: 31/Aug/16 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Charlie Swanson | Assignee: | Backlog - Query Optimization |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | optimization | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Optimization
|
| Participants: |
| Description |
|
If the $group stage spills to disk, then the results will be output in order of their _id. If this is the case, we could potentially take advantage of this knowledge, by removing a subsequent sort on _id, or by making a subsequent group convert to streaming. We should add some sort of prep stage to pipeline execution, so that we will know if the $group is going to spill to disk before we have to make decisions on whether outputs are sorted. |