-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
Query Optimization
-
(copied to CRM)
Consider the following scenario:
Collection is sharded on field "symbol":
db.coll.aggregate({$sort:{symbol:1, date:1}},{$group:{_id:"$symbol", first:{$first:"$start"},last:{$last:"$start"}, sum:{$sum:"$volume"}}})
This pipeline will merge because of sort even though it does not need to.
Related but not quite the same is SERVER-5477 which would allow the group to take place on the single shard in this example, but it wouldn't happen if $sort by shard key also wasn't correctly handled.
- is related to
-
SERVER-26321 Long-running aggregations can artificially time out if the first batch takes more than 10 minutes
- Closed
- related to
-
SERVER-28327 ClientCursorMonitor can timeout cursors prematurely
- Closed
-
SERVER-5477 when sharded, no need to merge groups if $group _id is the shard key or original document _id
- Backlog