As part of SERVER-35693, parsing a $in query will always sort the array argument before constructing a boost::flat_set. This greatly benefits the case where the number of elements is very large (>10k) and is unsorted, however as a side effect it hurts performance when the array is already sorted.
One option would be to add an optimization for the sorted case by checking std::is_sorted before sorting the array.
- related to
-
SERVER-136121 Add a collation performance test to QHVW; sys-perf has none after PERF-9520
-
- Needs Scheduling
-