[SERVER-54822] Push $sort before $unwind when possible Created: 26/Feb/21 Updated: 29/Oct/23 Resolved: 14/Jun/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 4.4.4 |
| Fix Version/s: | 5.1.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Renato Riccio | Assignee: | Militsa Sotirova |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Sprint: | Query Optimization 2021-05-17, Query Optimization 2021-05-31, Query Optimization 2021-06-14, Query Optimization 2021-06-28 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
$sort should be pushed automatically before $unwind if sort is happening on a different field.
|
| Comments |
| Comment by Vivian Ge (Inactive) [ 06/Oct/21 ] |
|
Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you! |
| Comment by Githook User [ 16/Jun/21 ] |
|
Author: {'name': 'Militsa Sotirova', 'email': 'militsa.sotirova@mongodb.com', 'username': 'militsasotirova'}Message: |
| Comment by Githook User [ 14/Jun/21 ] |
|
Author: {'name': 'Militsa Sotirova', 'email': 'militsa.sotirova@mongodb.com', 'username': 'militsasotirova'}Message: |
| Comment by David Percy [ 30/Apr/21 ] |
|
We should make sure this doesn't inhibit the $lookup + $unwind optimization. If you have $lookup, $unwind, $sort, and the $lookup can absorb the $unwind, it would be bad if the $sort stage somehow got stuck in between. |