It seems there is a case that SERVER-110423 did not fix. If there is an alternative index available then we can still use the sparse index. Note that if the compound index was not there then we would correctly use a collscan.
- is related to
-
SERVER-110423 $group can use a distinct scan on a sparse index, which hides null/missing results
-
- Closed
-
- related to
-
SERVER-111541 Extract common parts of isIndexSuitableForDistinct and getIndexEntriesForDistinct
-
- In Code Review
-