-
Type: Task
-
Resolution: Gone away
-
Priority: Critical - P2
-
Affects Version/s: None
-
Labels:
Description
The "Array Sort Behavior" section of the 3.6 compatibility notes discuss the change implemented via SERVER-19402. There is a nice "IMPORTANT" note that mentions the potential performance degradation associated with this change when sorting on an array field.
It is also possible to encounter the degraded performance even if you are not sorting on the array field itself. This occurs when the multikey index was built on version 3.2 or earlier and has not been rebuilt since upgrading to 3.4 which introduced multiKeyPaths metadata. Without this metadata the optimizer only knows that some indexed field is an array, but not which one specifically. As a result it must use the conservative behavior and generate a blocking sort to ensure correctness.
Consider noting this caveat in the documentation as it is presently not clear what the problem is or what the fix is if a user were to encounter this situation.