[SERVER-12262] Use full index scan as proxy for collection scan in order to make certain queries covered Created: 06/Jan/14 Updated: 11/Jul/16 Resolved: 04/Mar/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 2.5.4 |
| Fix Version/s: | 2.6.0-rc1 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | David Storch | Assignee: | David Storch |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
The old query system would prefer full index scans to collection scans in the case of covered queries. For example, with an index on field 'foo' consider the following query:
This query would be covered by the index, hence this test which asserts that explain.indexOnly is true. The new query system does not try to construct full index scans for things like $exists and $nin, preferring a collection scan instead. This means that in the new system, a FETCH stage is required and the query is not covered. As a performance improvement, we could eliminate these fetches and make such queries covered. |
| Comments |
| Comment by Githook User [ 04/Mar/14 ] |
|
Author: {u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}Message: |
| Comment by David Storch [ 03/Mar/14 ] |
|
$nin was already changed to be able to use an index as part of |
| Comment by Samantha Ritter (Inactive) [ 03/Mar/14 ] |
|
|