[SERVER-19152] Reorder $project to be after limits and skips Created: 26/Jun/15 Updated: 26/Jun/15 Resolved: 26/Jun/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Craig Wilson | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Description |
|
I was looking at the optimizing aggregation pipelines docs page and didn't see this one listed. I don't know what the cost is to do a bunch of projections only to take the first 3 of them, but reordering the pipeline to push $project before limits and skips would remove the question. So:
would look like this:
In addition, doing this might allow further skip/limit coalescence to further optimize the pipeline. |