[SERVER-3173] Planner should use path-level multikey info to generate covered plans when possible Created: 31/May/11 Updated: 19/Sep/17 Resolved: 13/Jan/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance |
| Affects Version/s: | None |
| Fix Version/s: | 3.5.2 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Antoine Girbal | Assignee: | David Storch |
| Resolution: | Done | Votes: | 32 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | Query 2017-01-23 | ||||||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
In this example, I want to get a list of user names for a particular event.
See that multikey is true even though the requested field (name) is not multikey. An alternative would be to add a hint flag to force covered index. |
| Comments |
| Comment by Githook User [ 13/Jan/17 ] |
|
Author: {u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}Message: This allows queries using a multikey index which project out |
| Comment by Aaron Staple [ 08/Nov/12 ] |
|
One thing to note for the implementation is that if there is an array on a field that is not being projected, we would still need to dedup results. For example, index { a:1, b:1 }projection { a:1, _id:0 }doc { a:4, b:5 }-> key { '':4, '':5 }doc { a:4, b:[ 5, 6 ] }-> two keys { '':4, '':5 }, { '':4, '':6 }We'd probably dedup based on disk loc to avoiding returning 4 two times, but deduping is not currently a requirement for a non multikey index. |