<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:25:54 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-31072] reorder $limit before $lookup in pipeline</title>
                <link>https://jira.mongodb.org/browse/SERVER-31072</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;In pipeline: &lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;[ ... {$lookup:{}}, {$addFields:{}}, {$lookup:{}}, {$limit:10}, ... ]&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;moving $limit before the first $lookup stage will significantly reduce the amount of work that lookup and addFields have to do.  We currently don&apos;t reorder $limit with $lookup, it appears.&lt;/p&gt;</description>
                <environment></environment>
        <key id="426901">SERVER-31072</key>
            <summary>reorder $limit before $lookup in pipeline</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="13201">Fixed</resolution>
                                        <assignee username="katherine.wu@mongodb.com">Katherine Wu</assignee>
                                    <reporter username="asya.kamsky@mongodb.com">Asya Kamsky</reporter>
                        <labels>
                            <label>QFB</label>
                            <label>asya</label>
                            <label>neweng</label>
                            <label>optimization</label>
                            <label>performance</label>
                            <label>qopt-team</label>
                            <label>storch</label>
                    </labels>
                <created>Wed, 13 Sep 2017 05:06:32 +0000</created>
                <updated>Mon, 30 Oct 2023 23:13:39 +0000</updated>
                            <resolved>Tue, 17 Dec 2019 16:27:43 +0000</resolved>
                                                    <fixVersion>4.3.3</fixVersion>
                                    <component>Aggregation Framework</component>
                                        <votes>1</votes>
                                    <watches>14</watches>
                                                                                                                <comments>
                            <comment id="2636876" author="xgen-internal-githook" created="Tue, 17 Dec 2019 16:14:52 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Katherine Wu&apos;, &apos;email&apos;: &apos;katherine.wu@mongodb.com&apos;, &apos;username&apos;: &apos;kaywux&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-31072&quot; title=&quot;reorder $limit before $lookup in pipeline&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-31072&quot;&gt;&lt;del&gt;SERVER-31072&lt;/del&gt;&lt;/a&gt; reorder $limit before $lookup in pipeline if no $unwind is present&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/ae6b595845dd9975af01774678d52e93043a0d27&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/ae6b595845dd9975af01774678d52e93043a0d27&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2474823" author="david.storch" created="Wed, 9 Oct 2019 22:33:21 +0000"  >&lt;p&gt;This came up in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-43297&quot; title=&quot;Inefficient query on view due to $limit and $skip stages not being pushed down&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-43297&quot;&gt;&lt;del&gt;SERVER-43297&lt;/del&gt;&lt;/a&gt;. Flagging for consideration as a quick win. This change would enhance our ability to push $limit down into the PlanStage layer, beneath DocumentSourceCursor and beneath the MULTI_PLAN stage. This can reduce the amount of data examined by applying the limit prior to DocumentSourceCursor batching and prior to any buffering of partial result sets during multi-planning.&lt;/p&gt;</comment>
                            <comment id="1691478" author="david.storch" created="Fri, 6 Oct 2017 15:01:15 +0000"  >&lt;p&gt;This is probably better solved by eliminating batching behavior in DocumentSourceCursor. This is tracked by &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27829&quot; title=&quot;Reduce performance impact of DocumentSourceCursor batching&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27829&quot;&gt;SERVER-27829&lt;/a&gt;, but is complex due to the changes required in locking behavior.&lt;/p&gt;</comment>
                            <comment id="1682937" author="asya" created="Wed, 27 Sep 2017 11:11:38 +0000"  >&lt;p&gt;I see there&apos;s a comment about that here:&lt;/p&gt;

&lt;p&gt;Related ticket: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-26442?focusedCommentId=1471207&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-1471207&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/SERVER-26442?focusedCommentId=1471207&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-1471207&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So maybe the sort reorder before $lookup should be handled there.&lt;/p&gt;</comment>
                            <comment id="1682928" author="asya" created="Wed, 27 Sep 2017 10:51:17 +0000"  >&lt;p&gt;Not sure if this ticket should also cover moving $sort (on top document field) before $lookup or if that should be a separate ticket (since limit sometimes gets absorbed into $sort I think they are related).&lt;/p&gt;</comment>
                            <comment id="1671538" author="asya" created="Wed, 13 Sep 2017 05:10:22 +0000"  >&lt;p&gt;Obviously this optimization can only be safely applied to a $lookup without an $unwind.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="320662">SERVER-26442</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="924519">SERVER-43297</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="349556">SERVER-27829</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </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_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></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 2017 15:01:15 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 8 weeks, 1 day 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_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-1552</customfieldvalue>
                        </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>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 8 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>asya.kamsky@mongodb.com</customfieldvalue>
            <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>katherine.wu@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hteprb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr6r7z:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="3287">Query 2019-12-16</customfieldvalue>
    <customfieldvalue id="3288">Query 2019-12-30</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|htebun:</customfieldvalue>

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