[SERVER-9332] Mongos should re-write $in queries on the shard key before sending them to the shards so that the shards only receive the relevant portion of the $in Created: 11/Apr/13 Updated: 06/Dec/22 Resolved: 10/Nov/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance, Sharding |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Spencer Brody (Inactive) | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Duplicate | Votes: | 10 |
| Labels: | graphquery | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Assigned Teams: |
Query
|
||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||||||
| Description |
|
In a sharded environment, a query like
should be re-written by mongos by first resolving each _id value to the containing shard then sending the corresponding sub-qery to the right shard (assuming that _id is the shard key). For example, if 100, 300, 500 belong to shard1 and 200, 400, 600 belong to shard2 MongoS should make exactly 2 queries:
to shard1
to shard2. |
| Comments |
| Comment by Asya Kamsky [ 06/Sep/17 ] |
|
This looks like a duplicate of SERVER-1007 |