<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:54: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>[JAVA-1551] DBCursor slowness</title>
                <link>https://jira.mongodb.org/browse/JAVA-1551</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;We are using Spring Data with the MongoDB Java driver.  &lt;br/&gt;
We create an aggregation using AggregationOptions.OutputMode.CURSOR &lt;br/&gt;
There are 2 fields in the projection on a collection with almost 800K documents.&lt;br/&gt;
The aggregation does not use a sort or group; only a match and projection.&lt;br/&gt;
The aggregation matches on a single String value that is indexed.&lt;br/&gt;
The expected result set is all of the documents except 2 (over 700K).&lt;br/&gt;
The DBCursor.next() method seems very slow.  I&apos;ve tried a smaller data set with OutputMode.INLINE and the next method is much faster.&lt;/p&gt;

&lt;p&gt;Here is the entire loop:&lt;br/&gt;
        while (cursor.hasNext()) {&lt;br/&gt;
            DBObject obj = cursor.next();&lt;br/&gt;
            logger.warn(&quot;count=&quot; + count++);&lt;br/&gt;
            if (count % 10000 == 0) &lt;/p&gt;
{
                logger.warn(&quot;count=&quot; + count);
            }
&lt;p&gt;        }&lt;/p&gt;

&lt;p&gt;Here are some timing from the logs:&lt;/p&gt;

&lt;p&gt;14 Nov 2014 14:44:56,328 WARN : TestDistributionFilter,207 - count=6133&lt;br/&gt;
14 Nov 2014 14:44:56,418 WARN : TestDistributionFilter,207 - count=6134&lt;br/&gt;
14 Nov 2014 14:44:56,508 WARN : TestDistributionFilter,207 - count=6135&lt;br/&gt;
14 Nov 2014 14:44:56,597 WARN : TestDistributionFilter,207 - count=6136&lt;br/&gt;
14 Nov 2014 14:44:56,686 WARN : TestDistributionFilter,207 - count=6137&lt;br/&gt;
14 Nov 2014 14:44:56,776 WARN : TestDistributionFilter,207 - count=6138&lt;/p&gt;

&lt;p&gt;It seems odd that it is taking almost 100 milisecs to pull back a single record from the server.  I&apos;ve commented out the record logging but that did not help much.&lt;/p&gt;

&lt;p&gt;What can we do to speed it up?&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;gozer&lt;/p&gt;</description>
                <environment>RedHat server windows client</environment>
        <key id="169402">JAVA-1551</key>
            <summary>DBCursor slowness</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="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="michael.gozaloff@bankofamerica.com">Mike Gozaloff</reporter>
                        <labels>
                    </labels>
                <created>Fri, 14 Nov 2014 19:50:03 +0000</created>
                <updated>Wed, 11 Sep 2019 19:11:39 +0000</updated>
                            <resolved>Fri, 14 Nov 2014 22:02:00 +0000</resolved>
                                    <version>2.12.3</version>
                                                    <component>Performance</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="764917" author="jeff.yemin" created="Fri, 14 Nov 2014 22:02:00 +0000"  >&lt;p&gt;Glad that you figured it out.&lt;/p&gt;</comment>
                            <comment id="764912" author="michael.gozaloff@bankofamerica.com" created="Fri, 14 Nov 2014 21:58:52 +0000"  >&lt;p&gt;I was able in increase the speed by adjusting the batch size.  The sample code I copied had it set to 1 which is less than optimal.  You can go ahead and close this issue.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;gozer&lt;/p&gt;</comment>
                            <comment id="764801" author="michael.gozaloff@bankofamerica.com" created="Fri, 14 Nov 2014 20:34:44 +0000"  >&lt;p&gt;I realize that google groups is the preferred starting point.  The problem is that the bank blocks access to google groups.  I&apos;ve been digging through stackoverflow and other various posts. Have not found a similar posting.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;gozer&lt;/p&gt;
</comment>
                            <comment id="764751" author="jeff.yemin" created="Fri, 14 Nov 2014 19:58:11 +0000"  >&lt;p&gt;Thanks for the report.  Do you have reason to suspect that this is an issue with the Java driver itself?  Otherwise, it&apos;s best to start off discussions like this in the &lt;a href=&quot;https://groups.google.com/forum/#!forum/mongodb-user&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb-user&lt;/a&gt; forum.  From there someone can help you to determine whether there is a problem with your application or whether a SERVER or JAVA issue should be opened.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Jeff&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hs3znb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>148184</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>