[SERVER-11278] indexOnly false when query should be covered Created: 18/Oct/13 Updated: 10/Dec/14 Resolved: 19/Oct/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 2.4.6 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | David Wartell | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux |
||
| Operating System: | Linux |
| Steps To Reproduce: | db.Test.insert( {"_id" : ObjectId("5261ac33e4b070ca9e1480d1"), "date" : ISODate("2013-10-18T21:46:27.476Z"), "disabled" : false, "userHidden" : false, "postId" : NumberLong(103)}) db.Test.ensureIndex( { "postId" : 1, "userHidden" : 1, "disabled" : 1, "date" : -1}, {name: "findByPostId", sparse: true, unique: false}) db.Test.find( { $query: {postId: 103, userHidden: false, disabled: false}, $orderby: {date: -1}, $hint: "findByPostId", $explain: 1 }, {postId: 1, userHidden: 1, disabled: 1, date: 1 }).pretty() { , { "$minElement" : 1 } ] , { "$minElement" : 1 } ] According to docs and everything I can find there is no reason this query should not be indexOnly: true and it is false |
| Participants: |
| Description |
|
Index does not have fields that are sub documents or arrays and indexOnly is false on what should be a covered query |
| Comments |
| Comment by David Wartell [ 18/Oct/13 ] |
|
Please CLOSE. Not a bug. Apologies I was convinced this was a bug. This was the problem: By adding _id: 0 to the projection I get indexOnly true |