<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:17:44 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-8549] Not in covered index query does not have nscannedObjects = 0 </title>
                <link>https://jira.mongodb.org/browse/SERVER-8549</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Expecting a covered index query to have nscannedObjects to be 0 with a nin query on the indexed field. This is the case when the index is a regular, unique or sparse unique.&lt;/p&gt;</description>
                <environment>&amp;gt; db.version()&lt;br/&gt;
2.4.0-rc0&lt;br/&gt;
on OS X</environment>
        <key id="65161">SERVER-8549</key>
            <summary>Not in covered index query does not have nscannedObjects = 0 </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="3">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="sridhar">Sridhar Nanjundeswaran</reporter>
                        <labels>
                    </labels>
                <created>Wed, 13 Feb 2013 18:21:09 +0000</created>
                <updated>Fri, 15 Feb 2013 15:06:54 +0000</updated>
                            <resolved>Wed, 13 Feb 2013 19:14:11 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="265397" author="aaron" created="Wed, 13 Feb 2013 19:12:49 +0000"  >&lt;p&gt;Hi Sridhar - in this case nscannedObjects is being reported based on the current matching implementation which does not implement covered index matching for $nin predicates.  The ticket for implementing that in this case is &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3187&quot; title=&quot;keymatch optimizations, in particular for negative predicates&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3187&quot;&gt;&lt;del&gt;SERVER-3187&lt;/del&gt;&lt;/a&gt;.  Also in this example indexOnly is being reported incorrectly.  The ticket for fixing that is &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;.&lt;/p&gt;</comment>
                            <comment id="265351" author="sridhar" created="Wed, 13 Feb 2013 18:23:15 +0000"  >&lt;p&gt;Error on the assert is assert: &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt; != &lt;span class=&quot;error&quot;&gt;&amp;#91;28&amp;#93;&lt;/span&gt; are not equal : simple.1.8 - nscannedObjects should be 0 for covered query&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="37762">SERVER-5759</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="17863">SERVER-3187</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="65171">SERVER-8551</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 13 Feb 2013 19:12:49 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        11 years, 1 week 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>ian@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            11 years, 1 week 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>sridhar</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrn6pb:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>42805</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_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>
&lt;p&gt;testDB = db.getSiblingDB(&quot;qa293&quot;)&lt;br/&gt;
var coll = testDB.getCollection(&quot;simple.1&quot;)&lt;br/&gt;
coll.drop()&lt;br/&gt;
for (i=0;i&amp;lt;10;i++) {&lt;br/&gt;
    coll.insert(&lt;/p&gt;
{foo:i}
&lt;p&gt;)&lt;br/&gt;
}&lt;br/&gt;
for (i=0;i&amp;lt;10;i++) {&lt;br/&gt;
    coll.insert(&lt;/p&gt;
{foo:i}
&lt;p&gt;)&lt;br/&gt;
}&lt;br/&gt;
for (i=0;i&amp;lt;5;i++) {&lt;br/&gt;
    coll.insert(&lt;/p&gt;
{bar:i}
&lt;p&gt;)&lt;br/&gt;
}&lt;br/&gt;
coll.insert(&lt;/p&gt;
{foo:&quot;1&quot;}
&lt;p&gt;)&lt;br/&gt;
coll.insert({foo:{bar:1}})&lt;br/&gt;
coll.insert(&lt;/p&gt;
{foo:null}
&lt;p&gt;)&lt;br/&gt;
coll.ensureIndex(&lt;/p&gt;
{foo:1}
&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;// Test not in query&lt;br/&gt;
var plan = coll.find({foo:{$nin:&lt;span class=&quot;error&quot;&gt;&amp;#91;5,8&amp;#93;&lt;/span&gt;}}, &lt;/p&gt;
{foo:1, _id:0}
&lt;p&gt;).hint(&lt;/p&gt;
{foo:1}
&lt;p&gt;).explain()&lt;br/&gt;
assert.eq(true, plan.indexOnly, &quot;simple.1.8 - indexOnly should be true on covered query&quot;)&lt;br/&gt;
assert.eq(0, plan.nscannedObjects, &quot;simple.1.8 - nscannedObjects should be 0 for covered query&quot;)&lt;/p&gt;</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|ht05xz:</customfieldvalue>

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