-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Fully Compatible
-
ALL
-
v4.4
-
Query 2020-03-23, Query 2020-04-06
-
0
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.
- is duplicated by
-
SERVER-43993 Improve Document memory usage during blocking sort
- Closed
- related to
-
SERVER-67709 eliminate `visit_helper` namespace
- Closed