<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:50: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-60849] Remove nested loop joins from $Filter.limit SBE traverse stage</title>
                <link>https://jira.mongodb.org/browse/SERVER-60849</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Solution proposed by Anton: &lt;/p&gt;

&lt;p&gt;Data flow for this expression can be presented as follows:&lt;/p&gt;

&lt;p&gt;&amp;lt;main-tree&amp;gt;&lt;br/&gt;
This is the eval frame sitting on top of the evalStack when we start processing the $filter expression. This &amp;lt;main-tree&amp;gt; is used as an input to the entire expression (the input argument). So, the input argument can be evaluated on the same eval frame.&lt;/p&gt;

&lt;p&gt;&amp;lt;cond-tree&amp;gt;&lt;br/&gt;
Implements a filter predicate. It needs to be evaluated in its own frame since the evaluation should diverge from the main data flow - that is, for each element in an input array we will have to execute this &amp;lt;cond-tree&amp;gt;, so the array element will become the input to this tree.&lt;/p&gt;

&lt;p&gt;So, putting it together we have:&lt;/p&gt;

&lt;p&gt;traverse inSlot outSlot innerSlot&lt;br/&gt;
from&lt;br/&gt;
    project inSlot = &amp;lt;something&amp;gt;&lt;br/&gt;
   &amp;lt;main-tree&amp;gt;&lt;br/&gt;
in&lt;br/&gt;
   &amp;lt;cond-tree&amp;gt;&lt;br/&gt;
Now, lets add the limit argument. It can be a complex expression on its own, but its evaluation doesn&apos;t change the data flow. What I mean by that is, we don&apos;t have to short-circuit while evaluating the limit argument, and we don&apos;t have to create a new evaluation context like we do for the cond argument. We can simply evaluate it sequentially right after the input argument. In other words, it can be evaluated on the same eval frame as the input argument itself.&lt;/p&gt;

&lt;p&gt;traverse inSlot outSlot innerSlot {} &lt;/p&gt;
{getArraySize(outSlot) &amp;gt;= limitSlot}
&lt;p&gt;from&lt;br/&gt;
    project limitSlot = &amp;lt;something&amp;gt;&lt;br/&gt;
   &amp;lt;limit-tree&amp;gt;&lt;br/&gt;
    project inSlot = &amp;lt;something&amp;gt;&lt;br/&gt;
   &amp;lt;main-tree&amp;gt;&lt;br/&gt;
in&lt;br/&gt;
   &amp;lt;cond-tree&amp;gt;&lt;br/&gt;
Now, there is one caveat here.&lt;/p&gt;

&lt;p&gt;The limit argument is being processed last, after the cond argument. The latter adds its own eval frame on the eval stack, so limit expressions would be evaluated against the &amp;lt;cond-tree&amp;gt; frame rather than &amp;lt;main-tree&amp;gt;. To deal with it we will have to pop the &amp;lt;cond-tree&amp;gt; frame off the stack (in in-visitor) and store it in FilterExprFrame, process limit against the main-tree frame, and then in $filter post-visitor grab the cond frame form theFilterExprFrame, rather than from the eval frame.&lt;/p&gt;

&lt;p&gt;Of course this all can be avoided if we evaluate the cond argument last, but I absolutely don&apos;t want to change the order of the $filter arguments depending on the presence of this optional limit. Optionals should always go last.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1903377">SERVER-60849</key>
            <summary>Remove nested loop joins from $Filter.limit SBE traverse stage</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="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-query-execution">Backlog - Query Execution</assignee>
                                    <reporter username="maddie.zechar@mongodb.com">Maddie Zechar</reporter>
                        <labels>
                    </labels>
                <created>Wed, 20 Oct 2021 14:33:44 +0000</created>
                <updated>Tue, 6 Dec 2022 00:51:21 +0000</updated>
                                                                                                <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="4163356" author="kyle.suarez" created="Tue, 2 Nov 2021 15:11:18 +0000"  >&lt;p&gt;We don&apos;t quite have enough context on this to triage this properly at the meeting. Tagging &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=eric.cox&quot; class=&quot;user-hover&quot; rel=&quot;eric.cox&quot;&gt;eric.cox&lt;/a&gt; to please speak to &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=anton.korshunov&quot; class=&quot;user-hover&quot; rel=&quot;anton.korshunov&quot;&gt;anton.korshunov&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=maddie.zechar&quot; class=&quot;user-hover&quot; rel=&quot;maddie.zechar&quot;&gt;maddie.zechar&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="4135331" author="maddie.zechar" created="Wed, 20 Oct 2021 14:34:21 +0000"  >&lt;p&gt;tagging &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=anton.korshunov&quot; class=&quot;user-hover&quot; rel=&quot;anton.korshunov&quot;&gt;anton.korshunov&lt;/a&gt;&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>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25125"><![CDATA[Query Execution]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 2 Nov 2021 15:11:18 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 14 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-2104</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>alexander.golin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 14 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-query-execution</customfieldvalue>
            <customfieldvalue>kyle.suarez@mongodb.com</customfieldvalue>
            <customfieldvalue>maddie.zechar@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i06kzz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr28rj:</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_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|i0675b:</customfieldvalue>

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