<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:46:36 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-81477] $lookup against sparse index</title>
                <link>https://jira.mongodb.org/browse/SERVER-81477</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;In Mongodb 7.0, I started getting extraordinarily long query times for some aggregate queries with $lookup. Namely, if the aggregate query was looking up against a collection using a field that had a sparse index:&lt;/p&gt;

&lt;p&gt;document.student.createIndex(&lt;/p&gt;
{&apos;teacher_id&apos;: 1}
&lt;p&gt;, {&lt;br/&gt;
  partialFilterExpression: {&apos;teacher_id&apos;: {&lt;br/&gt;
    $exists: true,&lt;br/&gt;
  }},&lt;br/&gt;
});&lt;/p&gt;

&lt;p&gt;db.teacher.aggregate([{$lookup: {from: &apos;student&apos;, let: &lt;/p&gt;
{teacherId: &apos;$_id&apos;}
&lt;p&gt;, pipeline: [{&apos;$match&apos;: {&apos;$expr&apos;: {$eq: &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;$teacher_id&amp;#39;, &amp;#39;$$teacherId&amp;#39;&amp;#93;&lt;/span&gt;}}}], as: &apos;students&apos;}}]);&lt;/p&gt;

&lt;p&gt;This is somewhat related to, but different from the following:&lt;br/&gt;
&lt;a href=&quot;https://www.mongodb.com/community/forums/t/conditional-lookup/3833/10&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://www.mongodb.com/community/forums/t/conditional-lookup/3833/10&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-44749&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/SERVER-44749&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="2452038">SERVER-81477</key>
            <summary>$lookup against sparse index</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="9">Done</resolution>
                                        <assignee username="rhea.thorne@mongodb.com">Alison Rhea Thorne</assignee>
                                    <reporter username="ben@ethika.com">Ben Rotz</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Sep 2023 22:59:07 +0000</created>
                <updated>Wed, 8 Nov 2023 16:09:57 +0000</updated>
                            <resolved>Wed, 8 Nov 2023 16:09:57 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="5864639" author="JIRAUSER1274755" created="Wed, 8 Nov 2023 16:09:57 +0000"  >&lt;p&gt;We haven&#8217;t heard back from you for some time, so I&#8217;m going to close this ticket. If this is still an issue for you, please provide additional information and we will reopen the ticket.&lt;/p&gt;</comment>
                            <comment id="5799109" author="JIRAUSER1274755" created="Mon, 23 Oct 2023 14:36:14 +0000"  >&lt;p&gt;We still need additional information to diagnose the problem. If this is still an issue for you, would you please provide the information requested?&lt;/p&gt;</comment>
                            <comment id="5758664" author="JIRAUSER1274755" created="Fri, 6 Oct 2023 12:33:45 +0000"  >&lt;p&gt;Hello &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ben%40ethika.com&quot; class=&quot;user-hover&quot; rel=&quot;ben@ethika.com&quot;&gt;ben@ethika.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thank you for your report. Just to clarify, it seems your report was filed in regards to sparse indexes, however the index that you have present in your reproduction is a partial index. Regardless, I did have a few questions in regards to your report to better assist with triaging this issue:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Does &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-40362&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;SERVER-40362&lt;/a&gt; also match what you are seeing?&lt;/li&gt;
	&lt;li&gt;Can you clarify how significant the degredation you&apos;ve observed was in comparison to before the upgrade?&lt;/li&gt;
	&lt;li&gt;How large is the dataset that you are running this against?&lt;/li&gt;
	&lt;li&gt;Can you provide a randomly generated example of said data to better our attempts at replication?&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;We&apos;ll also need FTDC and logs if you can provide them. I&apos;ve created a secure &lt;a href=&quot;https://amphora.corp.mongodb.com/public/upload/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmb2xkZXJfaWQiOiIyMjk1MTgwMzU2NzQiLCJleHAiOjE2OTkxODYzNzV9.a_LUHrpE_wvXElaW_dM8PWQAkpbPUiZoflWGrQK9ovk&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;upload portal&lt;/a&gt; for you. Files uploaded to this portal are hosted on Box, are visible only to MongoDB employees, and are routinely deleted after some time.&lt;/p&gt;

&lt;p&gt;For each node in the replica set spanning a time period that includes the incident (before and after your upgrade to 7.0.0), would you please archive (tar or zip) and upload to that link:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;the mongod logs&lt;/li&gt;
	&lt;li&gt;the $dbpath/diagnostic.data directory (the contents are described &lt;a href=&quot;https://docs.mongodb.com/manual/administration/analyzing-mongodb-performance/#full-time-diagnostic-data-capture&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    </comments>
                    <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, 6 Oct 2023 11:59:43 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        13 weeks 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>rhea.thorne@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            13 weeks 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>rhea.thorne@mongodb.com</customfieldvalue>
            <customfieldvalue>ben@ethika.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2s87j:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i2a5y4:</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_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>
                                    <customfieldvalue><![CDATA[rhea.thorne@mongodb.com]]></customfieldvalue>
    

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2rucv:</customfieldvalue>

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