<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:23:05 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-72894] Use traverseP expression to build the sort key for the common key prefix case</title>
                <link>https://jira.mongodb.org/browse/SERVER-72894</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Use traverseP expression to build the sort key for &lt;a href=&quot;https://github.com/10gen/mongo/blob/f4f236a38438fb84ff1e2ae6958a1795ddcdec68/src/mongo/db/query/sbe_stage_builder.cpp#L1265&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the common key prefix case&lt;/a&gt;. We should make sure the expression for the common prefix is only calculated once. We might need to add a workload for a longer key prefix to make sure it doesn&apos;t regress.&lt;/p&gt;

&lt;p&gt;Preliminary perf: &lt;a href=&quot;https://performance-analyzer.server-tig.prod.corp.mongodb.com/perf-analyzer-viz/?evergreen_version=63c582a232f4171734d0e297&amp;amp;evergreen_base_version=performance_550e070c93e80bdb4f256dd634128ad919395eb0&amp;amp;metrics_selection=Latency99thPercentile&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://performance-analyzer.server-tig.prod.corp.mongodb.com/perf-analyzer-viz/?evergreen_version=63c582a232f4171734d0e297&amp;amp;evergreen_base_version=performance_550e070c93e80bdb4f256dd634128ad919395eb0&amp;amp;metrics_selection=Latency99thPercentile&lt;/a&gt;||ops_per_sec||Latency50thPercentile||OperationThroughput||tpmC||NewOrders||Duration||average_read_latency_us||95th_read_latency_us||99th_read_latency_us&amp;amp;percent_filter=0||100&amp;amp;z_filter=0||10&lt;/p&gt;</description>
                <environment></environment>
        <key id="2234552">SERVER-72894</key>
            <summary>Use traverseP expression to build the sort key for the common key prefix case</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="rui.liu@mongodb.com">Rui Liu</assignee>
                                    <reporter username="rui.liu@mongodb.com">Rui Liu</reporter>
                        <labels>
                    </labels>
                <created>Tue, 17 Jan 2023 09:42:16 +0000</created>
                <updated>Tue, 17 Jan 2023 15:29:22 +0000</updated>
                            <resolved>Tue, 17 Jan 2023 15:27:13 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="5117698" author="JIRAUSER1261330" created="Tue, 17 Jan 2023 15:22:13 +0000"  >&lt;p&gt;There seems to be some further complication regarding MQL semantics. The following text is from &lt;a href=&quot;https://mongodbcr.appspot.com/758720001/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;Q: One question I have is, can you give some more context about why it&apos;s necessary to fall back to the old key generation logic in the case where two of the components share a prefix&lt;/p&gt;

&lt;p&gt;A:&lt;/p&gt;

&lt;p&gt;&quot;What&apos;s so tricky about the &apos;paths with a common prefix&apos; case?&quot;, you might ask.&lt;/p&gt;

&lt;p&gt;Normally, we can compute the sort key for each part of the sort pattern&lt;br/&gt;
independently. However, when two or more sort pattern parts have paths with a&lt;br/&gt;
common prefix, their sort keys need to be computed together.&lt;/p&gt;

&lt;p&gt;Let&apos;s consider an example. Suppose our sort pattern is &lt;/p&gt;
{&quot;a.b&quot;:1, &quot;a.c&quot;:1}
&lt;p&gt; and&lt;br/&gt;
we&apos;re computing the sort keys for the following document:&lt;/p&gt;

&lt;p&gt;  {a: [&lt;/p&gt;
{b:11,c:29}
&lt;p&gt;, &lt;/p&gt;
{b:11,c:28}
&lt;p&gt;, &lt;/p&gt;
{b:12,c:27}
&lt;p&gt;]}&lt;/p&gt;

&lt;p&gt;If we computed the sort keys for &quot;a.b&quot; and &quot;a.c&quot; independently, then the sort&lt;br/&gt;
key for &quot;a.b&quot; would be 11 and the sort key for &quot;a.c&quot; would 27. This is &lt;em&gt;not&lt;/em&gt;&lt;br/&gt;
what the classic execution engine does though.&lt;/p&gt;

&lt;p&gt;The classic execution engine will traverse the array in field &quot;a&quot; and search for&lt;br/&gt;
the sub-document where &quot;b&quot; is the smallest, and if there are ties it will use&lt;br/&gt;
field &quot;c&quot; to break the ties. In this example, the sub-document where &quot;b&quot; is the&lt;br/&gt;
smallest (using &quot;c&quot; to break ties) is &lt;/p&gt;
{b:11,c:28}
&lt;p&gt;. So the classic execution will&lt;br/&gt;
use 11 as the sort key for &quot;a.b&quot; and 28 as the sort key for &quot;a.c&quot;.&lt;/p&gt;

&lt;p&gt;I could implement this natively in SBE using TraverseStage. However, because I&lt;br/&gt;
would need to deal with multiple values in the TraverseStage but TraverseStage&lt;br/&gt;
only supports having one output slot and one fold expression, I would need to&lt;br/&gt;
put the multiple values inside an array (so that I could fold the values using a&lt;br/&gt;
single fold expression and return the values via a single output slot). There&apos;s&lt;br/&gt;
probably some non-trivial performance overhead to doing this, so I figured this&lt;br/&gt;
might be a good time to ask what people&apos;s thoughts are on the idea of updating&lt;br/&gt;
TraverseStage to support multiple output slots and multiple fold expressions.&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>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 3 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-2697</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>rui.liu@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            1 year, 3 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>rui.liu@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i1qupr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i18qys:</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="5928">QE 2023-01-23</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|i1qgv3:</customfieldvalue>

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