<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:05:09 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-4161] nscannedObjects is not calculated properly for covered index queries</title>
                <link>https://jira.mongodb.org/browse/SERVER-4161</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Overview:&lt;/p&gt;

&lt;p&gt;The &apos;nscannedObjects&apos; 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 &apos;nscannedObjects&apos; field is reported on a per query basis and also on a per query plan basis (in the allPlans section of the explain output).&lt;/p&gt;

&lt;p&gt;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:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;for a query, the nscannedObjects count includes cases where a document is read to perform query matching, a document is read to determine if it belongs to a valid chunk, or a document would be read to return a result (including all documents used to perform an in memory sort, but not covered index projections that aren&apos;t sorted in memory).&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;for a query plan, the nscannedObjects count includes cases where a document is read to perform query matching or a document must be read to return a result (as determined here &amp;lt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/6e555988bff53d807635ef59796c45c824b770ba/src/mongo/db/queryoptimizercursorimpl.cpp#L271-L290&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/6e555988bff53d807635ef59796c45c824b770ba/src/mongo/db/queryoptimizercursorimpl.cpp#L271-L290&lt;/a&gt;&amp;gt;).&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;-----------------------------------&lt;/p&gt;

&lt;p&gt;Expected nscannedObjects to be 0 for a covered index query but it is 1.&lt;/p&gt;

&lt;p&gt;for (var i = 1; i &amp;lt; 11; i++) {&lt;br/&gt;
  db.cindextest.insert(&lt;/p&gt;
{foo:i,bar:i*10}
&lt;p&gt;)&lt;br/&gt;
}&lt;br/&gt;
db.cindextest.ensureIndex(&lt;/p&gt;
{foo:1}
&lt;p&gt;)&lt;/p&gt;


&lt;p&gt;&amp;gt; db.cindextest.find(&lt;/p&gt;
{foo:1}
&lt;p&gt;,&lt;/p&gt;
{foo:1,_id:0}
&lt;p&gt;).explain()&lt;br/&gt;
{&lt;br/&gt;
        &quot;cursor&quot; : &quot;BtreeCursor foo_1&quot;,&lt;br/&gt;
        &quot;nscanned&quot; : 1,&lt;br/&gt;
        &quot;nscannedObjects&quot; : 1,                &amp;lt;------------- expected this to be 0&lt;br/&gt;
        &quot;n&quot; : 1,&lt;br/&gt;
        &quot;millis&quot; : 0,&lt;br/&gt;
        &quot;nYields&quot; : 0,&lt;br/&gt;
        &quot;nChunkSkips&quot; : 0,&lt;br/&gt;
        &quot;isMultiKey&quot; : false,&lt;br/&gt;
        &quot;indexOnly&quot; : true,&lt;br/&gt;
        &quot;indexBounds&quot; : &lt;/p&gt;
{
                &quot;foo&quot; : [
                        [
                                1,
                                1
                        ]
                ]
        }
&lt;p&gt;}&lt;/p&gt;</description>
                <environment>Windows 7 x64, MongoDB 2.0.1</environment>
        <key id="24154">SERVER-4161</key>
            <summary>nscannedObjects is not calculated properly for covered index queries</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="aaron">Aaron Staple</assignee>
                                    <reporter username="sridhar">Sridhar Nanjundeswaran</reporter>
                        <labels>
                            <label>coveredIndex</label>
                            <label>nscannedObjects</label>
                    </labels>
                <created>Thu, 27 Oct 2011 15:30:21 +0000</created>
                <updated>Mon, 11 Jul 2016 18:33:54 +0000</updated>
                            <resolved>Sun, 30 Sep 2012 18:36:57 +0000</resolved>
                                    <version>2.0.1</version>
                                    <fixVersion>2.3.0</fixVersion>
                                    <component>Index Maintenance</component>
                    <component>Querying</component>
                                        <votes>1</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="271099" author="auto" created="Wed, 20 Feb 2013 15:11:40 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2013-02-19T23:35:49Z&apos;, u&apos;name&apos;: u&apos;Sridhar Nanjundeswaran&apos;, u&apos;email&apos;: u&apos;sridhar@10gen.com&apos;}
&lt;p&gt;Message: Tests for &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4161&quot; title=&quot;nscannedObjects is not calculated properly for covered index queries&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4161&quot;&gt;&lt;del&gt;SERVER-4161&lt;/del&gt;&lt;/a&gt;. Covered index query for geo and hashed indexes&lt;/p&gt;

&lt;p&gt;Signed-off-by: Ian Whalen &amp;lt;ian.whalen@gmail.com&amp;gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/3f920f0e2bcd88a8b3f76239d9d2da5c1a061702&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/3f920f0e2bcd88a8b3f76239d9d2da5c1a061702&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="266618" author="auto" created="Thu, 14 Feb 2013 22:33:05 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2013-02-15T06:26:56Z&apos;, u&apos;name&apos;: u&apos;aaron&apos;, u&apos;email&apos;: u&apos;aaron@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-8575&quot; title=&quot;slowNightly tests failing on covered_index_negative_1.js&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-8575&quot;&gt;&lt;del&gt;SERVER-8575&lt;/del&gt;&lt;/a&gt; &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4161&quot; title=&quot;nscannedObjects is not calculated properly for covered index queries&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4161&quot;&gt;&lt;del&gt;SERVER-4161&lt;/del&gt;&lt;/a&gt; &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-5759&quot; title=&quot;indexOnly in explain() is not reported correctly&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-5759&quot;&gt;&lt;del&gt;SERVER-5759&lt;/del&gt;&lt;/a&gt; Disable descriptive testing of erroneous indexOnly reporting when the behavior is inconsistent in a sharded environment.  Fixes sharding_passthrough/covered_index_negative1 test.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/2d71e6ab2d42c3c1cc31d42e579dec8041f6cca4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/2d71e6ab2d42c3c1cc31d42e579dec8041f6cca4&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="266405" author="auto" created="Thu, 14 Feb 2013 19:01:07 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2013-02-14T00:25:30Z&apos;, u&apos;name&apos;: u&apos;Sridhar Nanjundeswaran&apos;, u&apos;email&apos;: u&apos;sridhar@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4161&quot; title=&quot;nscannedObjects is not calculated properly for covered index queries&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4161&quot;&gt;&lt;del&gt;SERVER-4161&lt;/del&gt;&lt;/a&gt; Covered index query tests&lt;/p&gt;

&lt;p&gt;Signed-off-by: Ian Whalen &amp;lt;ian.whalen@gmail.com&amp;gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/d013b483c917ff4a48c002c0c0a133a1f62f55cf&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/d013b483c917ff4a48c002c0c0a133a1f62f55cf&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="169066" author="auto" created="Fri, 28 Sep 2012 03:42:57 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-09-27T20:42:47-07:00&apos;, u&apos;email&apos;: u&apos;aaron@10gen.com&apos;, u&apos;name&apos;: u&apos;Aaron&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4161&quot; title=&quot;nscannedObjects is not calculated properly for covered index queries&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4161&quot;&gt;&lt;del&gt;SERVER-4161&lt;/del&gt;&lt;/a&gt; Exclude explainc test from multi version testing.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/99bf4aaa6722b5dfd0787c2682e0144cb1325a01&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/99bf4aaa6722b5dfd0787c2682e0144cb1325a01&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="169063" author="auto" created="Fri, 28 Sep 2012 03:18:59 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-09-24T10:57:29-07:00&apos;, u&apos;email&apos;: u&apos;aaron@10gen.com&apos;, u&apos;name&apos;: u&apos;Aaron&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4161&quot; title=&quot;nscannedObjects is not calculated properly for covered index queries&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4161&quot;&gt;&lt;del&gt;SERVER-4161&lt;/del&gt;&lt;/a&gt; Report nscannedObjects properly when covered indexes are used.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/6e555988bff53d807635ef59796c45c824b770ba&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/6e555988bff53d807635ef59796c45c824b770ba&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="169062" author="auto" created="Fri, 28 Sep 2012 03:18:57 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-09-21T16:04:40-07:00&apos;, u&apos;email&apos;: u&apos;aaron@10gen.com&apos;, u&apos;name&apos;: u&apos;Aaron&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4161&quot; title=&quot;nscannedObjects is not calculated properly for covered index queries&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4161&quot;&gt;&lt;del&gt;SERVER-4161&lt;/del&gt;&lt;/a&gt; Add ResultDetails struct for candidate result document retrieval metadata.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/3f02a780112135da725070a8c43b2d8195a9f434&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/3f02a780112135da725070a8c43b2d8195a9f434&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="166503" author="auto" created="Thu, 20 Sep 2012 21:18:39 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-09-01T20:45:59-07:00&apos;, u&apos;name&apos;: u&apos;Aaron&apos;, u&apos;email&apos;: u&apos;aaron@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4161&quot; title=&quot;nscannedObjects is not calculated properly for covered index queries&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4161&quot;&gt;&lt;del&gt;SERVER-4161&lt;/del&gt;&lt;/a&gt; Convert ResponseBuildStrategy::handleMatch() arguments to meet coding standards.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/54d3bc66d1931701fbe972eb0a602290daa3b6fb&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/54d3bc66d1931701fbe972eb0a602290daa3b6fb&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="63035">SERVER-8300</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="65335">SERVER-8575</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="37762">SERVER-5759</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="31016">SERVER-5019</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 20 Feb 2012 05:06:35 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        11 years ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            11 years ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>aaron</customfieldvalue>
            <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>sridhar</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hron1b:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrgg1z:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9510</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10166" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Tests Written</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10154"><![CDATA[Complete]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrs8e7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>