Details
-
New Feature
-
Resolution: Duplicate
-
Major - P3
-
None
-
None
-
None
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:
{ $project: { a: 1, b: 1} },
|
{ $skip: 10 }
|
would look like this:
{ $skip: 10 },
|
{ $project: {a :1, b: 1 } }
|
In addition, doing this might allow further skip/limit coalescence to further optimize the pipeline.
Attachments
Issue Links
- duplicates
-
SERVER-12376 $skip and $limit should be moved before $project
-
- Closed
-