<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:33: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-33364] Combined $match, $expr in aggregation not using indexes</title>
                <link>https://jira.mongodb.org/browse/SERVER-33364</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;While using $lookup stages in aggregation pipelines using the new &quot;Multiple Join Conditions&quot;, which requires $expr commands, the lookup uses COLLSCAN instead of indexes to fetch the destination values.&lt;/p&gt;

&lt;p&gt;In fact this seems to be a problem with the &quot;$expr&quot; command and not the $lookup phase itself. (see steps to reproduce)&lt;/p&gt;</description>
                <environment></environment>
        <key id="499033">SERVER-33364</key>
            <summary>Combined $match, $expr in aggregation not using indexes</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="danielp@bompracredito.com.br">Daniel Polistchuck</reporter>
                        <labels>
                    </labels>
                <created>Fri, 16 Feb 2018 12:11:32 +0000</created>
                <updated>Tue, 2 Jun 2020 18:22:19 +0000</updated>
                            <resolved>Fri, 16 Feb 2018 13:50:53 +0000</resolved>
                                    <version>3.6.0</version>
                    <version>3.6.2</version>
                                                    <component>Aggregation Framework</component>
                                        <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="2101589" author="bastosbf" created="Fri, 28 Dec 2018 14:04:47 +0000"  >&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;seems the $expr still does not use the correct index if if it a partial compound index (even when all filter criteria match).&lt;/p&gt;</comment>
                            <comment id="1808300" author="thomas.schubert" created="Fri, 16 Feb 2018 18:25:59 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=danielp%40bompracredito.com.br&quot; class=&quot;user-hover&quot; rel=&quot;danielp@bompracredito.com.br&quot;&gt;danielp@bompracredito.com.br&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;We&apos;ve just released MongoDB 3.6.3-rc0, which is our release candidate for MongoDB 3.6.3, and I&apos;d expect 3.6.3 GA to follow in about a week or so. Please feel free to upgrade to 3.6.3-rc0 to test the fix in the interim.&lt;/p&gt;

&lt;p&gt;Kind regards,&lt;br/&gt;
Kelsey&lt;/p&gt;</comment>
                            <comment id="1808244" author="david.storch" created="Fri, 16 Feb 2018 17:56:13 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=kelsey.schubert&quot; class=&quot;user-hover&quot; rel=&quot;kelsey.schubert&quot;&gt;kelsey.schubert&lt;/a&gt;, could you answer Daniel&apos;s question about about the anticipated timeframe for the 3.6.3 release?&lt;/p&gt;</comment>
                            <comment id="1808123" author="danielp@bompracredito.com.br" created="Fri, 16 Feb 2018 16:27:00 +0000"  >&lt;p&gt;Sorry, I didn&apos;t look up other candidate bug reports before reporting mine...&lt;br/&gt;
Now, the dreaded question that PMs hate: Any ETA for 3.6.3? &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;Cheers,&lt;/p&gt;

&lt;p&gt;Daniel&lt;/p&gt;</comment>
                            <comment id="1807931" author="david.storch" created="Fri, 16 Feb 2018 13:50:45 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=danielp%40bompracredito.com.br&quot; class=&quot;user-hover&quot; rel=&quot;danielp@bompracredito.com.br&quot;&gt;danielp@bompracredito.com.br&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thanks for this issue report! It looks like this is a duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-31760&quot; title=&quot;Lookup sub-pipeline is not using index for equality match&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-31760&quot;&gt;&lt;del&gt;SERVER-31760&lt;/del&gt;&lt;/a&gt;, which is a known issue affecting 3.6.0 through 3.6.2. The fix has been backported to the 3.6 branch and will be available in the 3.6.3 release. The fix is also available for testing in the 3.7.1 development release. Finally, note that &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-31760&quot; title=&quot;Lookup sub-pipeline is not using index for equality match&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-31760&quot;&gt;&lt;del&gt;SERVER-31760&lt;/del&gt;&lt;/a&gt; is documented as part of the &lt;a href=&quot;https://docs.mongodb.com/manual/release-notes/3.6/#known-issues-in-3-6-0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;known issues in 3.6.0&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Please let me know if you have any questions or concerns.&lt;/p&gt;

&lt;p&gt;Best,&lt;br/&gt;
Dave&lt;/p&gt;</comment>
                            <comment id="1807880" author="danielp@bompracredito.com.br" created="Fri, 16 Feb 2018 12:13:32 +0000"  >&lt;p&gt;I tried to use the monospace style in the issue text to format the queries, but it didn&apos;t seem to work.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="452431">SERVER-31760</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>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 16 Feb 2018 13:50:45 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            5 years, 6 weeks, 5 days ago
                        </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>bastosbf</customfieldvalue>
            <customfieldvalue>danielp@bompracredito.com.br</customfieldvalue>
            <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>kelsey.schubert@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htqkz3:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</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;Make sure the collection has an indexed property (ExternalId in this example). The query&lt;/p&gt;

&lt;p&gt;{{db.collection.aggregate([&lt;br/&gt;
                {&lt;br/&gt;
                    &quot;$match&quot;: {&quot;$expr&quot;: {&quot;$eq&quot;: &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;FullProposalId&amp;quot;,&amp;quot;123456&amp;quot;&amp;#93;&lt;/span&gt;}}&lt;br/&gt;
                }&lt;br/&gt;
            ],&lt;/p&gt;
{explain:true}
&lt;p&gt;)}}&lt;/p&gt;

&lt;p&gt;shows a COLLSCAN fetch stage&lt;br/&gt;
while the simple aggregation below (that cannot be used in lookups with &quot;lets&quot;):&lt;br/&gt;
{{db.collection.aggregate([&lt;br/&gt;
                {&lt;br/&gt;
                    &quot;$match&quot;: &lt;/p&gt;
{&quot;ExternalId&quot;:&quot;123456&quot;}
&lt;p&gt;                }&lt;br/&gt;
            ],&lt;/p&gt;
{explain:true}
&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;            }}&lt;br/&gt;
shows an IXSCAN stage (as epxected)&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|htq74n:</customfieldvalue>

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