[SERVER-24860] Optimize away entire pipeline if it can be answered using a query Created: 30/Jun/16 Updated: 29/Mar/22 Resolved: 03/Apr/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework, Querying |
| Affects Version/s: | None |
| Fix Version/s: | 4.1.10 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Charlie Swanson | Assignee: | Anton Korshunov |
| Resolution: | Done | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | Query 2017-04-17, Query 2017-05-08, Query 2017-05-29, Query 2019-03-11, Query 2019-03-25, Query 2019-04-08 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Linked BF Score: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
An aggregation pipeline can be used to represent a query, like the following:
In these cases, it would be more efficient to skip the aggregation layer, and execute the entire computation using a query. It is expected that pipelines like the above pipeline will be much more common once non-materialized views are introduced in |
| Comments |
| Comment by Githook User [ 03/Apr/19 ] | |
|
Author: {'name': 'Anton Korshunov', 'username': 'antkorsh', 'email': 'anton.korshunov@mongodb.com'}Message: | |
| Comment by Asya Kamsky [ 22/Mar/19 ] | |
|
Yes, that's fine. | |
| Comment by Anton Korshunov [ 21/Mar/19 ] | |
|
asya just want to double check that you're ok with the proposed name for this boolean flag. Dave and Charlie are fine with the name.
| |
| Comment by Asya Kamsky [ 13/Mar/19 ] | |
|
anton.korshunov I think the new format is fine, I agree that additional flag with Boolean indicator what happened is nice to have. Especially since sometimes support gets explain output without the command that produced it. | |
| Comment by Craig Homa [ 28/Feb/19 ] | |
|
Removed from the all cursors globally managed epic as this was always more of a 'nice to have' and not a goal in the original scope. | |
| Comment by Kyle Suarez [ 05/Sep/18 ] | |
|
See | |
| Comment by Mathias Stearn [ 30/Jun/16 ] | |
|
This could also handle cases including $skip and $limit, although we'd have to reverse the limit-before-skip optimization before pushing down to the query system because it logically is skip-then-limit (although it has a similar optimization when combined with sorts). |