[SERVER-78047] Push $limit stage into $sort pushdown for time-series collection Created: 13/Jun/23 Updated: 29/Oct/23 Resolved: 11/Jul/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.1.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Alice Li (Inactive) | Assignee: | Alice Li (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 | ||||||||
| Participants: | |||||||||
| Description |
|
Add time-series query rewrite to push $limit into $sort (for sort on the metadata field) so that we don't sort buckets that are not necessary It is safe to assume that every bucket has at least one measurement. We should rewrite [\{$_unpack}, \{$sort}, \{$limit: x}] pipeline as [\{$sort(with limit)}, \{$_unpack}, \{$limit: x}] |
| Comments |
| Comment by Githook User [ 05/Jul/23 ] |
|
Author: {'name': 'Alice Li', 'email': 'alice.li@mongodb.com', 'username': ''}Message: |