<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:56:41 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-1316] single object update, by _id, seems slow</title>
                <link>https://jira.mongodb.org/browse/SERVER-1316</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;see test code below.  11 sec for multi update vs. 70sec from the shell on localhost.  that seems like an awfully big difference to me.  surely can be better for the iterative case?  &lt;/p&gt;

&lt;p&gt;-----------------------&lt;/p&gt;

&lt;p&gt;x = &lt;/p&gt;
{ classname: &quot;aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&quot; }
&lt;p&gt;;&lt;/p&gt;

&lt;p&gt;t = db.foo;&lt;br/&gt;
t.drop();&lt;/p&gt;

&lt;p&gt;start = new Date();&lt;/p&gt;

&lt;p&gt;for( var i = 0; i &amp;lt; 500000; i++ )&lt;br/&gt;
    t.insert&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/error.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;;&lt;br/&gt;
print( tojson( db.getLastError() ) );&lt;/p&gt;

&lt;p&gt;print(&quot;insert done&quot;);&lt;br/&gt;
print(new Date() - start);&lt;br/&gt;
// e.g., 29secs&lt;/p&gt;

&lt;p&gt;print(t.count());&lt;/p&gt;

&lt;p&gt;start = new Date();&lt;/p&gt;

&lt;p&gt;// multi update version&lt;br/&gt;
t.update(&lt;/p&gt;
{ classname: x.classname }
&lt;p&gt;, { $set: &lt;/p&gt;
{ classname: &quot;aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbb&quot;}
&lt;p&gt; }, false, true);&lt;br/&gt;
// e.g., 11sec&lt;/p&gt;

&lt;p&gt;/* manual iteration version&lt;br/&gt;
t.find(&lt;/p&gt;
{&apos;classname&apos;:x.classname}
&lt;p&gt;).forEach( &lt;br/&gt;
  function(u)&lt;br/&gt;
  // faster: &lt;br/&gt;
  // &lt;/p&gt;
{ u.classname=&quot;com.abcdefghijkl&quot;; t.save(u); }
&lt;p&gt;  &lt;br/&gt;
  // e.g., 56secs&lt;/p&gt;

&lt;p&gt;  // slower:&lt;/p&gt;
  { u.classname=&quot;aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbb&quot;; t.save(u); } 
&lt;p&gt;  // e.g., 70sec&lt;br/&gt;
);&lt;br/&gt;
*/&lt;br/&gt;
print( tojson( db.getLastError() ) );&lt;/p&gt;

&lt;p&gt;print(&quot;modifications done&quot;);&lt;br/&gt;
print( new Date() - start );&lt;/p&gt;

&lt;p&gt;print(t.count());&lt;/p&gt;</description>
                <environment></environment>
        <key id="12276">SERVER-1316</key>
            <summary>single object update, by _id, seems slow</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="9">Done</resolution>
                                        <assignee username="eliot">Eliot Horowitz</assignee>
                                    <reporter username="dwight@mongodb.com">Dwight Merriman</reporter>
                        <labels>
                    </labels>
                <created>Mon, 28 Jun 2010 21:51:19 +0000</created>
                <updated>Tue, 12 Jul 2016 00:28:54 +0000</updated>
                            <resolved>Tue, 19 Apr 2011 16:31:05 +0000</resolved>
                                                    <fixVersion>1.9.0</fixVersion>
                                    <component>Performance</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="51706" author="dwight_10gen" created="Wed, 31 Aug 2011 12:25:23 +0000"  >&lt;p&gt;call db.getLastError() after the insert.  this is not done&lt;br/&gt;
automatically.  that&apos;s not the issue, i think, but will make the&lt;br/&gt;
results more meaningful.&lt;/p&gt;

&lt;p&gt;the problem could be that the shell is slow &amp;#8211; it can&apos;t keep up with&lt;br/&gt;
the database.  if you did the test from C or C++ or Java i think you&lt;br/&gt;
would see a different result.  if the db isn&apos;t maxing out one core,&lt;br/&gt;
that&apos;s the problem.&lt;/p&gt;



</comment>
                            <comment id="51664" author="eliot" created="Wed, 31 Aug 2011 02:49:14 +0000"  >&lt;p&gt;Not sure what you mean - can you try 2.0.0-rc0, and if there are problems open a ticket with your issues.&lt;/p&gt;</comment>
                            <comment id="51659" author="axlfu" created="Wed, 31 Aug 2011 00:49:52 +0000"  >&lt;p&gt;Could you please explain a bit how to resolve? or the where is the source code about this issue&lt;br/&gt;
Thanks&lt;/p&gt;</comment>
                            <comment id="15149" author="eliot" created="Mon, 28 Jun 2010 22:27:24 +0000"  >&lt;p&gt;I&apos;m 90% sure its because of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-665&quot; title=&quot;special case simple queries for speed in qo&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-665&quot;&gt;&lt;del&gt;SERVER-665&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="11363">SERVER-665</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 28 Jun 2010 22:27:24 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 25 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/SERVER-665'>SERVER-665</a></s>]]></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>false</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>
                            12 years, 25 weeks 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_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>dwight@mongodb.com</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>axlfu</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpknr:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>22014</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>
                                

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

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