[SERVER-43630] Use SortPattern instead of raw BSON in query planner Created: 25/Sep/19 Updated: 29/Oct/23 Resolved: 27/Feb/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | 4.3.4 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Ian Boros | Assignee: | Svilen Mihaylov (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | neweng, qopt-team | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Sprint: | Query 2019-12-30, Query 2020-02-24, Query 2020-03-09 | ||||||||
| Participants: | |||||||||
| Description |
|
Now that SortPattern is exposed, and we have a type-safe representation of a sort pattern, we should use it in the query planner.
There are many places where we use raw BSON in the planner.
This work would involve creating a SortPattern as part of canonicalization, and hanging it off of the CanonicalQuery. Then, updating all callers of QueryRequest::getSort() in the query planner to use the sort pattern instead. |
| Comments |
| Comment by Svilen Mihaylov (Inactive) [ 27/Feb/20 ] | |
|
Need to split ticket: SERVER-46456 | |
| Comment by Githook User [ 27/Feb/20 ] | |
|
Author: {'username': 'smihaylov-mongodb', 'name': 'Svilen Mihaylov', 'email': 'svilen.mihaylov@mongodb.com'}Message: | |
| Comment by Svilen Mihaylov (Inactive) [ 25/Feb/20 ] | |
| Comment by Svilen Mihaylov (Inactive) [ 20/Feb/20 ] | |
|
So I believe this would entail setting this pattern into the QueryRequest object, and then vending it out for every user of getSort(). I see however several instances where the _sort field is updated directly, looks like from serialization. Ideally all other things equal we want to remove the _sort as long we dont lose needed info, and update to the new struct. | |
| Comment by Svilen Mihaylov (Inactive) [ 20/Feb/20 ] | |
|
I see a SortPattern is already created in cannonical_query around line 298.
| |
| Comment by David Storch [ 07/Jan/20 ] | |
|
eric.cox, if you end up working on this (my understanding is that regular project work should open up soon and take priority), then please add me as a code reviewer. Thanks! |