Execute $group on shardPart instead of mergerPart
Basically what is described here: https://www.mongodb.com/community/forums/t/how-to-enforce-mongodb-to-execute-group-on-shardpart-of-the-execution-plan/267560
When running covered count queries that could be aggregated independently on the shards, there is still a lot of overhead due to the fact that shards have to report documents with _id to mongos
It looks like this is happening for count queries that use $limit stage, but not for count queries without it
1
vote
