SERVER-138066ClosedFixed
$shardedDataDistribution is slow when the chunk count is large
The current {{$shardedDataDistribution}} performs a {{$lookup}} operation on {{config.chunks}} to determine which shards contain chunks for each sharded collection. The observed execution plan used the \{uuid: 1, min: 1} index instead of the existing \{uuid: 1, shard: 1, min: 1} index. Therefore, it examines every chunk document matching the collection's UUID to collect the distinct shards ids. Consequently, the work grows with the total number of chunks across the collections being process