[SERVER-4161] nscannedObjects is not calculated properly for covered index queries Created: 27/Oct/11 Updated: 11/Jul/16 Resolved: 30/Sep/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance, Querying |
| Affects Version/s: | 2.0.1 |
| Fix Version/s: | 2.3.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Sridhar Nanjundeswaran | Assignee: | Aaron Staple |
| Resolution: | Done | Votes: | 1 |
| Labels: | coveredIndex, nscannedObjects | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 7 x64, MongoDB 2.0.1 |
||
| Issue Links: |
|
||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Description |
|
Overview: The 'nscannedObjects' field in the explain output for a query describes the number of documents that would be read from the data store to perform a query. (This count does not include cases where an index key is read but the document that index key comes from is not read.) The 'nscannedObjects' field is reported on a per query basis and also on a per query plan basis (in the allPlans section of the explain output). Reporting nscannedObjects is not implemented by checking directly if the data layer has read a document, but by determining if the document would have been read at different stages of query handling on a case by case basis. Per this ticket, nscannedObjects is now reported as follows:
----------------------------------- Expected nscannedObjects to be 0 for a covered index query but it is 1. for (var i = 1; i < 11; i++) { ) ) > db.cindextest.find( {foo:1}, {foo:1,_id:0}).explain() } |
| Comments |
| Comment by auto [ 20/Feb/13 ] |
|
Author: {u'date': u'2013-02-19T23:35:49Z', u'name': u'Sridhar Nanjundeswaran', u'email': u'sridhar@10gen.com'}Message: Tests for Signed-off-by: Ian Whalen <ian.whalen@gmail.com> |
| Comment by auto [ 14/Feb/13 ] |
|
Author: {u'date': u'2013-02-15T06:26:56Z', u'name': u'aaron', u'email': u'aaron@10gen.com'}Message: |
| Comment by auto [ 14/Feb/13 ] |
|
Author: {u'date': u'2013-02-14T00:25:30Z', u'name': u'Sridhar Nanjundeswaran', u'email': u'sridhar@10gen.com'}Message: Signed-off-by: Ian Whalen <ian.whalen@gmail.com> |
| Comment by auto [ 28/Sep/12 ] |
|
Author: {u'date': u'2012-09-27T20:42:47-07:00', u'email': u'aaron@10gen.com', u'name': u'Aaron'}Message: |
| Comment by auto [ 28/Sep/12 ] |
|
Author: {u'date': u'2012-09-24T10:57:29-07:00', u'email': u'aaron@10gen.com', u'name': u'Aaron'}Message: |
| Comment by auto [ 28/Sep/12 ] |
|
Author: {u'date': u'2012-09-21T16:04:40-07:00', u'email': u'aaron@10gen.com', u'name': u'Aaron'}Message: |
| Comment by auto [ 20/Sep/12 ] |
|
Author: {u'date': u'2012-09-01T20:45:59-07:00', u'name': u'Aaron', u'email': u'aaron@10gen.com'}Message: |