<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:55: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-1938] Drive counts fs.chunks and fs.files every time when new GridFS</title>
                <link>https://jira.mongodb.org/browse/JAVA-1938</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;It counts on fs.files and fs.chunks every time to build index on collections when new a GridFS object.&lt;/p&gt;

&lt;p&gt;Source code in com.mongodb.gridfs.GirdFS :&lt;/p&gt;


&lt;p&gt; // ensure standard indexes as long as collections are small&lt;br/&gt;
        try {&lt;br/&gt;
            if (_filesCollection.count() &amp;lt; 1000) &lt;/p&gt;
{
                _filesCollection.ensureIndex( BasicDBObjectBuilder.start().add( &quot;filename&quot; , 1 ).add( &quot;uploadDate&quot; , 1 ).get() );
            }
&lt;p&gt;            if (_chunkCollection.count() &amp;lt; 1000) &lt;/p&gt;
{
                _chunkCollection.ensureIndex( BasicDBObjectBuilder.start().add( &quot;files_id&quot; , 1 ).add( &quot;n&quot; , 1 ).get() ,
                        BasicDBObjectBuilder.start().add( &quot;unique&quot; , true ).get() );
            }
&lt;p&gt;        } catch (MongoException e) &lt;/p&gt;
{
             LOGGER.info(String.format(&quot;Unable to ensure indices on GridFS collections in database %s&quot;, db.getName()));
        }


&lt;p&gt;I think it should check on the index exists ,not the row counts .&lt;/p&gt;
</description>
                <environment>Linux</environment>
        <key id="227289">JAVA-1938</key>
            <summary>Drive counts fs.chunks and fs.files every time when new GridFS</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="3">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="carl.dong@windfindtech.com">carl dong</reporter>
                        <labels>
                    </labels>
                <created>Thu, 27 Aug 2015 09:47:46 +0000</created>
                <updated>Wed, 27 Jan 2016 22:45:33 +0000</updated>
                            <resolved>Wed, 2 Sep 2015 09:28:31 +0000</resolved>
                                    <version>2.13.0</version>
                                                    <component>GridFS</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1020343" author="ross@10gen.com" created="Wed, 2 Sep 2015 09:28:31 +0000"  >&lt;p&gt;Duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-389&quot; title=&quot;Make GridFS index check/ensure less costly&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-389&quot;&gt;&lt;del&gt;JAVA-389&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1015804" author="ross@10gen.com" created="Thu, 27 Aug 2015 10:59:57 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=carl.dong%40windfindtech.com&quot; class=&quot;user-hover&quot; rel=&quot;carl.dong@windfindtech.com&quot;&gt;carl.dong@windfindtech.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thanks for the ticket,  this ensures that the index is only created if there is only a small amount of existing data.  As &lt;tt&gt;ensureIndex&lt;/tt&gt; checks for the index and creates it if necessary, if there was a lot of existing data then this could be expensive and blocking.&lt;/p&gt;

&lt;p&gt;As part of the forthcoming 3.2 version of the driver we a new GridFS implementation is included, which follows the new specification and does as you suggest, checks the index exists rather than the counts.&lt;/p&gt;

&lt;p&gt;Ross&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="18826">JAVA-389</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <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|hscrgn:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>