<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:22:57 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-10357] An update $push with sort is slower than expected</title>
                <link>https://jira.mongodb.org/browse/SERVER-10357</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Seems like adding a $sort to a $push + $slice commands results in an unreasonably large slowdown.  A slowdown is expected for large arrays, but it is surprising to see a 5x change when sorting an already sorted array of length 100.&lt;/p&gt;

&lt;p&gt;Note: I have only tested this on 2.5.0, dont have comparisons between versions&lt;/p&gt;

&lt;p&gt;Results from reproduction code using benchRun on various array sizes:&lt;/p&gt;

&lt;p&gt;Array length 1:&lt;br/&gt;
    Sort:    18280&lt;br/&gt;
    No sort: 19936&lt;br/&gt;
    Change: 1.1x&lt;/p&gt;

&lt;p&gt;Array length 10:&lt;br/&gt;
    Sort:    15300&lt;br/&gt;
    No sort: 19400&lt;br/&gt;
    Change: 1.3x&lt;/p&gt;

&lt;p&gt;Array length 100:&lt;br/&gt;
    Sort:     3230&lt;br/&gt;
    No sort: 16660&lt;br/&gt;
    Change: 5.2x&lt;/p&gt;

&lt;p&gt;Array length 1,000:&lt;br/&gt;
    Sort:     230&lt;br/&gt;
    No sort: 2176&lt;br/&gt;
    Change: 9.5x&lt;/p&gt;

&lt;p&gt;Array length 10,000:&lt;br/&gt;
    Sort: 70&lt;br/&gt;
    No sort: 450&lt;br/&gt;
    Change: 6.4x&lt;/p&gt;

&lt;p&gt;Array length: 100,000:&lt;br/&gt;
    Sort: 30&lt;br/&gt;
    No sort: 260&lt;br/&gt;
    Change: 8.7x&lt;/p&gt;</description>
                <environment></environment>
        <key id="83652">SERVER-10357</key>
            <summary>An update $push with sort is slower than expected</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="andrew.emil@10gen.com">Andrew Emil</assignee>
                                    <reporter username="andrew.emil@10gen.com">Andrew Emil</reporter>
                        <labels>
                    </labels>
                <created>Fri, 26 Jul 2013 18:53:11 +0000</created>
                <updated>Wed, 10 Dec 2014 23:15:32 +0000</updated>
                            <resolved>Thu, 22 May 2014 14:44:39 +0000</resolved>
                                    <version>2.5.0</version>
                                                    <component>Performance</component>
                    <component>Write Ops</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                    <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="81839">SERVER-10159</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="29289" name="sortTest.js" size="1831" author="andrew.emil@10gen.com" created="Mon, 29 Jul 2013 13:53:13 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 26 Jul 2013 19:04:23 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            10 years, 29 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </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>andrew.emil@10gen.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrmlav:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>104197</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;&amp;gt; db.brsort.drop()&lt;br/&gt;
true&lt;br/&gt;
&amp;gt; db.brsort.insert({_id : 1, list : []})&lt;br/&gt;
&amp;gt; sort&lt;br/&gt;
{&lt;br/&gt;
	&quot;ops&quot; : [&lt;br/&gt;
		{&lt;br/&gt;
			&quot;ns&quot; : &quot;test.brsort&quot;,&lt;br/&gt;
			&quot;op&quot; : &quot;update&quot;,&lt;br/&gt;
			&quot;query&quot; : &lt;/p&gt;
{
				&quot;_id&quot; : 1
			}
&lt;p&gt;,&lt;br/&gt;
			&quot;update&quot; : {&lt;br/&gt;
				&quot;$push&quot; : {&lt;br/&gt;
					&quot;list&quot; : {&lt;br/&gt;
						&quot;$each&quot; : [&lt;/p&gt;
							{
								&quot;b&quot; : 1
							}
&lt;p&gt;						],&lt;br/&gt;
						&quot;$slice&quot; : -100,&lt;br/&gt;
						&quot;$sort&quot; : &lt;/p&gt;
{
							&quot;b&quot; : 1
						}
&lt;p&gt;					}&lt;br/&gt;
				}&lt;br/&gt;
			}&lt;br/&gt;
		}&lt;br/&gt;
	],&lt;br/&gt;
	&quot;parallel&quot; : 1,&lt;br/&gt;
	&quot;seconds&quot; : 10&lt;br/&gt;
}&lt;br/&gt;
&amp;gt;benchRun(sort)&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|hsbxjb:</customfieldvalue>

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