[SERVER-7408] Need to handle $limit differently in sharding if before first $sort or $group Created: 18/Oct/12 Updated: 11/Jul/16 Resolved: 05/Nov/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | 2.2.2, 2.3.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Mathias Stearn | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Participants: |
| Description |
|
On a single system the following aggregation can't return a count > 10:
On a sharded system, this can return a count of 10 * numShards. We probably want the limit applied both on the shard (for speedup) and on the mongos (for correctness). Luckily, this isn't likely to affect many users since $limit usually follows a $sort or a $group which both force everything after to run in mongos. |
| Comments |
| Comment by auto [ 06/Nov/12 ] |
|
Author: {u'date': u'2012-10-18T21:21:45Z', u'email': u'mathias@10gen.com', u'name': u'Mathias Stearn'}Message: This bug only comes up if the first $skip or $limit precedes the first |
| Comment by auto [ 05/Nov/12 ] |
|
Author: {u'date': u'2012-10-18T21:21:45Z', u'email': u'mathias@10gen.com', u'name': u'Mathias Stearn'}Message: This bug only comes up if the first $skip or $limit precedes the first |