[SERVER-45763] Optimize extractKeyFast() fallback path Created: 24/Jan/20 Updated: 29/Oct/23 Resolved: 01/Apr/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.4.0-rc0, 4.7.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Justin Seyster | Assignee: | Ian Boros |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | qexec-team | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||
| Backport Requested: |
v4.4
|
||||||||||||||||||||||||
| Sprint: | Query 2020-03-23, Query 2020-04-06 | ||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Linked BF Score: | 0 | ||||||||||||||||||||||||
| Description |
|
The SortKeyGenerator::extractKeyFast checks to see if a path in the sort key traverses any array, and if an array is found, it returns failure so that the caller can use the slower path that supports array traversal. Simply checking the array path, though, triggers a conversion for fields in the input Document, so that they can reside in the Document's Value cash. That conversion is expensive if there are large documents or arrays along the path, and all that work gets thrown away if an array is encountered anywhere along the path: the "slow" path operates on the underlying BSON and gets no benefit from the cached Values. We could speed up some queries if we had a way to perform the check in extractKeyFastPath() without doing any BSON -> Value conversions. |
| Comments |
| Comment by Githook User [ 02/Apr/20 ] |
|
Author: {'name': 'Ian Boros', 'email': 'ian.boros@mongodb.com', 'username': 'puppyofkosh'}Message: (cherry picked from commit 5557279e9ca9c78fbeb1026fc1a48a5c7c334b71) |
| Comment by Githook User [ 01/Apr/20 ] |
|
Author: {'name': 'Ian Boros', 'email': 'ian.boros@mongodb.com', 'username': 'puppyofkosh'}Message: |