<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:53:00 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-92] $all doesn&apos;t work well with the query optimzer</title>
                <link>https://jira.mongodb.org/browse/SERVER-92</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>
&lt;p&gt;take a look at the new test:  jstests/index_check2.js&lt;/p&gt;

&lt;p&gt;if this is too much - just assign it back to me.&lt;/p&gt;</description>
                <environment></environment>
        <key id="10200">SERVER-92</key>
            <summary>$all doesn&apos;t work well with the query optimzer</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="eliot">Eliot Horowitz</reporter>
                        <labels>
                    </labels>
                <created>Wed, 3 Jun 2009 16:16:49 +0000</created>
                <updated>Tue, 12 Jul 2016 00:29:17 +0000</updated>
                            <resolved>Fri, 5 Jun 2009 12:14:33 +0000</resolved>
                                                    <fixVersion>0.9.4</fixVersion>
                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="10195" author="aaron" created="Fri, 5 Jun 2009 12:14:33 +0000"  >&lt;p&gt;1fd840fd64b9147631262bd7ad09ede9b6f9fcbb&lt;/p&gt;</comment>
                            <comment id="10194" author="aaron" created="Fri, 5 Jun 2009 11:55:22 +0000"  >&lt;p&gt;You&apos;re right, that would be an improvement.  I&apos;ll implement it.&lt;/p&gt;</comment>
                            <comment id="10190" author="eliot" created="Thu, 4 Jun 2009 11:44:34 +0000"  >&lt;p&gt;For $in, that makes sense, but for $all can&apos;t we just iterate only one of the entires?  Ideally it would be the shortest, but random would be better than what is now.&lt;/p&gt;

&lt;p&gt;I&apos;ve updated the test to make it more clear.&lt;/p&gt;</comment>
                            <comment id="10189" author="aaron" created="Thu, 4 Jun 2009 11:25:21 +0000"  >&lt;p&gt;No, it&apos;s fine.  &apos;nscanned&apos; is the number of keys scanned, not documents.&lt;/p&gt;</comment>
                            <comment id="10188" author="aaron" created="Thu, 4 Jun 2009 11:22:01 +0000"  >&lt;p&gt;Seems like nscanned is too high though, I&apos;ll take a look.&lt;/p&gt;</comment>
                            <comment id="10187" author="aaron" created="Thu, 4 Jun 2009 11:09:47 +0000"  >&lt;p&gt;When you query an indexed field using $all, the index is scanned from the lowest value to the highest value in the $all array.  We do the same thing for $in.  It would be more efficient to skip quickly through the index from one value in the array to the next rather than scanning through all intermediate indexed values not present in the array, but that would require a fair amount of work to implement.  You can see what&apos;s happening by looking at the start / end keys in the full explain() output:&lt;/p&gt;

&lt;p&gt;&amp;gt; t.find( { tags: &lt;/p&gt;
{ $all: [ &quot;tag6&quot;, &quot;tag12&quot; ] }
&lt;p&gt; } ).explain();&lt;br/&gt;
{&quot;cursor&quot; : &quot;BtreeCursor tags_1&quot; , &quot;startKey&quot; : &lt;/p&gt;
{&quot;tags&quot; : &quot;tag12&quot;}
&lt;p&gt; , &quot;endKey&quot; : &lt;/p&gt;
{&quot;tags&quot; : &quot;tag6&quot;}
&lt;p&gt; , &quot;nscanned&quot; : 3460 , &quot;n&quot; : 60 , &quot;millis&quot; : 58 , &quot;oldPlan&quot; : {&quot;cursor&quot; : &quot;BtreeCursor tags_1&quot; , &quot;startKey&quot; : &lt;/p&gt;
{&quot;tags&quot; : &quot;tag12&quot;}
&lt;p&gt; , &quot;endKey&quot; : {&quot;tags&quot; : &quot;tag6&quot;}} , &quot;allPlans&quot; : [{&quot;cursor&quot; : &quot;BtreeCursor tags_1&quot; , &quot;startKey&quot; : &lt;/p&gt;
{&quot;tags&quot; : &quot;tag12&quot;}
&lt;p&gt; , &quot;endKey&quot; : {&quot;tags&quot; : &quot;tag6&quot;}}]}&lt;/p&gt;

&lt;p&gt;A different query with explicit bounds has the same start and end keys:&lt;br/&gt;
&amp;gt; t.find( { tags: &lt;/p&gt;
{ $gte: &quot;tag12&quot;, $lte: &quot;tag6&quot; }
&lt;p&gt; } ).explain();&lt;br/&gt;
{&quot;cursor&quot; : &quot;BtreeCursor tags_1&quot; , &quot;startKey&quot; : &lt;/p&gt;
{&quot;tags&quot; : &quot;tag12&quot;}
&lt;p&gt; , &quot;endKey&quot; : &lt;/p&gt;
{&quot;tags&quot; : &quot;tag6&quot;}
&lt;p&gt; , &quot;nscanned&quot; : 3460 , &quot;n&quot; : 980 , &quot;millis&quot; : 81 , &quot;oldPlan&quot; : {&quot;cursor&quot; : &quot;BtreeCursor tags_1&quot; , &quot;startKey&quot; : &lt;/p&gt;
{&quot;tags&quot; : &quot;tag12&quot;}
&lt;p&gt; , &quot;endKey&quot; : {&quot;tags&quot; : &quot;tag6&quot;}} , &quot;allPlans&quot; : [{&quot;cursor&quot; : &quot;BtreeCursor tags_1&quot; , &quot;startKey&quot; : &lt;/p&gt;
{&quot;tags&quot; : &quot;tag12&quot;}
&lt;p&gt; , &quot;endKey&quot; : {&quot;tags&quot; : &quot;tag6&quot;}}]}&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 4 Jun 2009 11:09:47 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        14 years, 37 weeks, 5 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>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            14 years, 37 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>aaron</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpy1j:</customfieldvalue>

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

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

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