-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
On a sharded collection,
coll.createIndex({shardKey: 1, notShardKey: 1}) coll.explain().aggregate([ {$match: {shardKey: {$gte: "foo"}}}, {$group: {_id: "$notShardKey"}} ])
seems to result in an IXSCAN, even though a DISTINCT_SCAN on could be used. The equivalent distinct() command results in a DISTINCT_SCAN.