<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:17:04 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-8300] Covered multi-key query still scans</title>
                <link>https://jira.mongodb.org/browse/SERVER-8300</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;index exists: &lt;/p&gt;
{ t:1, lc:1, wpm:1}

&lt;p&gt;through the Java library I use the &lt;br/&gt;
com.mongodb.DBCollection,find(DBObject ref, DBObject keys)&lt;/p&gt;

&lt;p&gt;with keys = &lt;/p&gt;
{lc: 1, t:1, wpm:1, _id: 0}

&lt;p&gt;and this query is logged as &lt;/p&gt;

&lt;p&gt;Wed Jan 23 17:31:09 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn5342&amp;#93;&lt;/span&gt; query jerome5.Unit query: { wpm: &lt;/p&gt;
{ $gte: 0.008999999612569809 }
&lt;p&gt;, t: &lt;/p&gt;
{ $in: [ &quot;Central&quot;, &quot;Commission&quot;, &quot;Kenya&quot;, &quot;CKRC&quot;, &quot;East&quot;, &quot;Mandera&quot;, &quot;Constituency&quot;, &quot;Report&quot;, &quot;North&quot;, &quot;Province&quot;, &quot;Rhamu&quot; ] }
&lt;p&gt;, lc: &lt;/p&gt;
{ $in: [ &quot;por&quot;, &quot;est&quot;, &quot;pol&quot;, &quot;vie&quot;, &quot;isl&quot;, &quot;nor&quot;, &quot;ita&quot;, &quot;deu&quot;, &quot;ces&quot;, &quot;eng&quot;, &quot;hun&quot;, &quot;sqi&quot;, &quot;slk&quot;, &quot;hin&quot;, &quot;slv&quot;, &quot;nld&quot;, &quot;tur&quot;, &quot;dan&quot;, &quot;cat&quot;, &quot;fra&quot;, &quot;fin&quot;, &quot;esl&quot;, &quot;sve&quot;, &quot;lav&quot; ] }
&lt;p&gt; } ntoreturn:0 ntoskip:0 nscanned:210 keyUpdates:0 numYields: 1 locks(micros) r:106836 nreturned:83 reslen:3694 126ms&lt;/p&gt;

&lt;p&gt;I then ran an explain on a similar query:&lt;/p&gt;

&lt;p&gt;db.Unit.find({ wpm: &lt;/p&gt;
{ $gte: 0.008999999612569809 }
&lt;p&gt;, t: &lt;/p&gt;
{ $in: [ &quot;knocking&quot;, &quot;witnesses&quot;, &quot;care&quot;, &quot;off&quot;, &quot;you&quot;, &quot;systematically&quot;, &quot;and&quot; ] }
&lt;p&gt;, lc: &lt;/p&gt;
{ $in: [ &quot;ukr&quot;, &quot;slk&quot;, &quot;cat&quot;, &quot;zho&quot;, &quot;deu&quot;, &quot;fra&quot;, &quot;por&quot;, &quot;fin&quot;, &quot;hin&quot;, &quot;ces&quot;, &quot;slv&quot;, &quot;nld&quot;, &quot;kor&quot;, &quot;est&quot;, &quot;jap&quot;, &quot;rus&quot;, &quot;ara&quot;, &quot;pol&quot;, &quot;eng&quot;, &quot;vie&quot;, &quot;sve&quot;, &quot;esl&quot;, &quot;hun&quot;, &quot;isl&quot;, &quot;lav&quot;, &quot;ell&quot;, &quot;tur&quot;, &quot;bel&quot;, &quot;nor&quot;, &quot;bul&quot;, &quot;dan&quot;, &quot;sqi&quot;, &quot;ita&quot;, &quot;mkd&quot; ] }
&lt;p&gt; }, &lt;/p&gt;
{t: 1, lc: 1, wpm: 1, _id: 0}
&lt;p&gt;).explain();&lt;br/&gt;
{&lt;br/&gt;
	&quot;cursor&quot; : &quot;BtreeCursor t_1_lc_1_wpm_1 multi&quot;,&lt;br/&gt;
	&quot;isMultiKey&quot; : false,&lt;br/&gt;
	&quot;n&quot; : 63,&lt;br/&gt;
	&quot;nscannedObjects&quot; : 63,&lt;br/&gt;
	&quot;nscanned&quot; : 142,&lt;br/&gt;
	&quot;nscannedObjectsAllPlans&quot; : 480,&lt;br/&gt;
	&quot;nscannedAllPlans&quot; : 559,&lt;br/&gt;
	&quot;scanAndOrder&quot; : false,&lt;br/&gt;
	&quot;indexOnly&quot; : true,&lt;br/&gt;
	&quot;nYields&quot; : 6,&lt;br/&gt;
	&quot;nChunkSkips&quot; : 0,&lt;br/&gt;
	&quot;millis&quot; : 3566,&lt;/p&gt;

&lt;p&gt;I don&apos;t understand why nscannedObjects is &amp;gt; 0 especially is indexOnly is true. Since i&apos;m not asking for _id, everthing to return is already in the index, so why are any object scans happening?&lt;/p&gt;</description>
                <environment>RHEL5</environment>
        <key id="63035">SERVER-8300</key>
            <summary>Covered multi-key query still scans</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="2" iconUrl="https://jira.mongodb.org/images/icons/priorities/critical.svg">Critical - P2</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="aaron">Aaron Staple</assignee>
                                    <reporter username="niccottrell">Nic Cottrell (Personal)</reporter>
                        <labels>
                    </labels>
                <created>Wed, 23 Jan 2013 16:48:02 +0000</created>
                <updated>Fri, 7 Mar 2014 01:02:29 +0000</updated>
                            <resolved>Wed, 23 Jan 2013 19:10:05 +0000</resolved>
                                    <version>2.2.2</version>
                                                    <component>Querying</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="248862" author="aaron" created="Thu, 24 Jan 2013 18:03:11 +0000"  >&lt;p&gt;Hi Nic - If you have a multikey index (isMultiKey:true) we don&apos;t support covered indexing.  This is &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3173&quot; title=&quot;Planner should use path-level multikey info to generate covered plans when possible&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3173&quot;&gt;&lt;del&gt;SERVER-3173&lt;/del&gt;&lt;/a&gt;.  Also please keep in mind that there are some cases (though not your examples) where indexOnly is reported incorrectly: &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="248850" author="niccottrell" created="Thu, 24 Jan 2013 17:52:51 +0000"  >&lt;p&gt;I have a related issue, but which reports &quot;indexOnly: false&quot; ...&lt;/p&gt;

&lt;p&gt;&amp;gt; db.Example.find(&lt;/p&gt;
{ lc: &quot;sve&quot;, group: &quot;all&quot;, &quot;indices.textLc&quot;: &quot;br&#228;cklig&quot; }
&lt;p&gt; ).explain();&lt;br/&gt;
{&lt;br/&gt;
	&quot;cursor&quot; : &quot;BtreeCursor indices.textLc_1_group_1_lc_1_clExists_1_wordCount_1_pattern_1&quot;,&lt;br/&gt;
	&quot;isMultiKey&quot; : true,&lt;br/&gt;
	&quot;n&quot; : 28,&lt;br/&gt;
	&quot;nscannedObjects&quot; : 28,&lt;br/&gt;
	&quot;nscanned&quot; : 28,&lt;br/&gt;
	&quot;nscannedObjectsAllPlans&quot; : 28,&lt;br/&gt;
	&quot;nscannedAllPlans&quot; : 28,&lt;br/&gt;
	&quot;scanAndOrder&quot; : false,&lt;br/&gt;
	&quot;indexOnly&quot; : false,&lt;br/&gt;
	&quot;nYields&quot; : 0,&lt;br/&gt;
	&quot;nChunkSkips&quot; : 0,&lt;br/&gt;
	&quot;millis&quot; : 0,&lt;br/&gt;
	&quot;indexBounds&quot; : {&lt;br/&gt;
		&quot;indices.textLc&quot; : [&lt;br/&gt;
			[&lt;br/&gt;
				&quot;br&#228;cklig&quot;,&lt;br/&gt;
				&quot;br&#228;cklig&quot;&lt;br/&gt;
			]&lt;br/&gt;
		],&lt;br/&gt;
		&quot;group&quot; : [&lt;br/&gt;
			[&lt;br/&gt;
				&quot;all&quot;,&lt;br/&gt;
				&quot;all&quot;&lt;br/&gt;
			]&lt;br/&gt;
		],&lt;br/&gt;
		&quot;lc&quot; : [&lt;br/&gt;
			[&lt;br/&gt;
				&quot;sve&quot;,&lt;br/&gt;
				&quot;sve&quot;&lt;br/&gt;
			]&lt;br/&gt;
		],&lt;/p&gt;


&lt;p&gt;Even if I only retrieve the &quot;group&quot; field, it still reports indexOnly: false&lt;/p&gt;</comment>
                            <comment id="247968" author="aaron" created="Wed, 23 Jan 2013 20:45:59 +0000"  >&lt;p&gt;Hi Nic - Well, the indexes are going to return their own BSON (representing the indexed fields extracted from the original doc) which is going to be scanned.  But the original document in the main document store won&apos;t be scanned.  It&apos;s just a reporting issue.&lt;/p&gt;</comment>
                            <comment id="247940" author="niccottrell" created="Wed, 23 Jan 2013 20:11:03 +0000"  >&lt;p&gt;So, no BSON is being scanned here - it&apos;s just a reporting issue?&lt;/p&gt;</comment>
                            <comment id="247883" author="aaron" created="Wed, 23 Jan 2013 19:10:05 +0000"  >&lt;p&gt;Hi Nic - Prior to 2.3.0, nscannedObjects was not reported correctly when covered indexes were used.  In these cases, the full documents were not being read to return query results, even though the explain output reported nscannedObjects as if the documents were being read.  The pertinent ticket is &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;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="24154">SERVER-4161</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>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 23 Jan 2013 19:10:05 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        11 years, 3 weeks, 6 days 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, 3 weeks, 6 days 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_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>aaron</customfieldvalue>
            <customfieldvalue>niccottrell</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrna3z:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>40561</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_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|hszx7r:</customfieldvalue>

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