[SERVER-50897] Fix Sort/Limit/Sort Optimization Created: 11/Sep/20 Updated: 29/Oct/23 Resolved: 26/Sep/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | 4.8.0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Eric Cox (Inactive) | Assignee: | Eric Cox (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Backport Requested: |
v4.7, v4.4
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Linked BF Score: | 7 | ||||||||||||||||
| Description |
|
A Fix for BF-18611. The gist here is that we need to be more careful when coalescing adjacent sorts. We can't simply optimize away the leading sort. We need to check if there is a limit stage in-between the adjacent sorts before deciding to optimize. If the sort key patterns are the same, then we can optimize the leading sort away, otherwise it's incorrect to merge the two sorts and take the min of a current limit and an adjacent limit. |
| Comments |
| Comment by Githook User [ 23/Oct/20 ] |
|
Author: {'name': 'Eric Cox', 'email': 'eric.cox@mongodb.com', 'username': 'ericox'}Message: (cherry picked from commit d54f13fe76a8a9be411966ecdbf840c520d43833) |
| Comment by Githook User [ 25/Sep/20 ] |
|
Author: {'name': 'Eric Cox', 'email': 'eric.cox@mongodb.com', 'username': 'ericox'}Message: |