<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:59:07 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-2148] $in with sort doesnt use index</title>
                <link>https://jira.mongodb.org/browse/SERVER-2148</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Query&lt;/p&gt;

&lt;p&gt;I have index on&lt;br/&gt;
db.ogloszenia2.ensureIndex(&lt;/p&gt;
{id:1, x:-1}
&lt;p&gt;);&lt;/p&gt;

&lt;p&gt;db.ogloszenia2.find({&quot;id&quot;:397).limit(200).sort({&quot;x&quot;:-1); //use index&lt;br/&gt;
db.ogloszenia2.find({&quot;id&quot;:422).limit(200).sort({&quot;x&quot;:-1); //use index&lt;br/&gt;
db.ogloszenia2.find({&quot;id&quot;:{$in:&lt;span class=&quot;error&quot;&gt;&amp;#91;397,422&amp;#93;&lt;/span&gt;}).limit(200); //use index&lt;/p&gt;

&lt;p&gt;db.ogloszenia2.find({&quot;id&quot;:{$in:&lt;span class=&quot;error&quot;&gt;&amp;#91;397,422&amp;#93;&lt;/span&gt;}).limit(200).sort({&quot;x&quot;:-1); //does not use index&lt;/p&gt;


</description>
                <environment>I`m not sure it not similar like &lt;a href=&quot;http://jira.mongodb.org/browse/SERVER-1205&quot;&gt;http://jira.mongodb.org/browse/SERVER-1205&lt;/a&gt;</environment>
        <key id="13802">SERVER-2148</key>
            <summary>$in with sort doesnt use index</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="ppalka@gratka-technologie.pl">ppalka</reporter>
                        <labels>
                    </labels>
                <created>Thu, 25 Nov 2010 15:25:28 +0000</created>
                <updated>Fri, 7 Mar 2014 01:00:20 +0000</updated>
                            <resolved>Wed, 14 Dec 2011 19:04:44 +0000</resolved>
                                    <version>1.6.4</version>
                                                    <component>Index Maintenance</component>
                    <component>Querying</component>
                                        <votes>11</votes>
                                    <watches>10</watches>
                                                                                                                <comments>
                            <comment id="118518" author="x2002g@gmail.com" created="Fri, 11 May 2012 08:29:37 +0000"  >&lt;p&gt;+1 vote. In this case, it&apos;s better to run &quot;sort&quot; on index than full table scan. Or I have to create an index on sort field and pray for good luck. &lt;/p&gt;</comment>
                            <comment id="21945" author="rcahearn" created="Thu, 30 Dec 2010 18:25:40 +0000"  >&lt;p&gt;I think this is a bug.&lt;/p&gt;

&lt;p&gt;As you can see from the output at &lt;a href=&quot;http://pastie.org/1417475&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://pastie.org/1417475&lt;/a&gt; the first query, which includes two $in fields, does use the index, while the last query, which has one $in clause cannot use the index even though it is specified with hint().  The query optimizer should handle which case would be slower when using the index, so specifically stating which index should be used should work.&lt;/p&gt;</comment>
                            <comment id="20724" author="eliot" created="Fri, 26 Nov 2010 05:23:23 +0000"  >&lt;p&gt;This is less a bug and more a lack of a feature.&lt;/p&gt;

&lt;p&gt;To use the index you&apos;d have to read multiple ranges and merge.&lt;/p&gt;

&lt;p&gt;IN some cases, that might actually be slower, so have to be careful.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="18552">SERVER-3310</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>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 26 Nov 2010 05:23:23 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        11 years, 40 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>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, 40 weeks, 5 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>eliot</customfieldvalue>
            <customfieldvalue>x2002g@gmail.com</customfieldvalue>
            <customfieldvalue>ppalka@gratka-technologie.pl</customfieldvalue>
            <customfieldvalue>rcahearn</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpawn:</customfieldvalue>

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

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

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