<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:15:29 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-7745] Add option to indexes to create counted b-tree for improved count() performance</title>
                <link>https://jira.mongodb.org/browse/SERVER-7745</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;It would be very useful to allow us to mark an index as counted (uses a counted b-tree rather than the current approach). This would result in larger indexes but would dramatically improve count() performance in most cases.&lt;/p&gt;</description>
                <environment></environment>
        <key id="57213">SERVER-7745</key>
            <summary>Add option to indexes to create counted b-tree for improved count() performance</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</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="-1">Unassigned</assignee>
                                    <reporter username="remonvv">Remon van Vliet</reporter>
                        <labels>
                            <label>count</label>
                            <label>performance</label>
                            <label>query</label>
                    </labels>
                <created>Thu, 22 Nov 2012 10:34:05 +0000</created>
                <updated>Mon, 19 May 2014 22:07:54 +0000</updated>
                            <resolved>Thu, 20 Dec 2012 18:38:46 +0000</resolved>
                                    <version>2.3.0</version>
                                                    <component>Index Maintenance</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="221179" author="remonvv" created="Fri, 21 Dec 2012 09:23:39 +0000"  >&lt;p&gt;Yep, agree. Thanks!&lt;/p&gt;</comment>
                            <comment id="220533" author="eliot" created="Thu, 20 Dec 2012 18:38:36 +0000"  >&lt;p&gt;Remon, those numbers look a lot better.&lt;br/&gt;
I think the direction we&apos;re going on optimization is the right approach, so going to close this.&lt;/p&gt;</comment>
                            <comment id="200030" author="remonvv" created="Tue, 27 Nov 2012 12:34:29 +0000"  >&lt;p&gt;Did a quick test, details here : &lt;a href=&quot;http://imgur.com/9nxyH&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://imgur.com/9nxyH&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Numbers are operations per second. All tests were done after the database was warmed up. There are some weird inconsistencies in the data (e.g. counts on a larger dataset or sometimes faster than on a smaller set) but those inconsistencies are there regardless of how many tests I run. This test was done single threaded. Will look at multithreaded diferences when I get some time for that.&lt;/p&gt;</comment>
                            <comment id="199855" author="eliot" created="Tue, 27 Nov 2012 06:42:25 +0000"  >&lt;p&gt;2.3.1 is up, so would be great to see the comparison&lt;/p&gt;</comment>
                            <comment id="199048" author="remonvv" created="Mon, 26 Nov 2012 12:11:25 +0000"  >&lt;p&gt;Makes sense. I&apos;ll run some benchmarks on this build and see if performance improvements are significant enough so that we can remove some of the workarounds in our code.&lt;/p&gt;</comment>
                            <comment id="198533" author="eliot" created="Sun, 25 Nov 2012 15:21:27 +0000"  >&lt;p&gt;Ah, single interval meaning one section of the btree.&lt;br/&gt;
SO x = 5 or x between 4 and 6&lt;/p&gt;

&lt;p&gt;$in, $or is handled elsewhere&lt;/p&gt;</comment>
                            <comment id="196658" author="remonvv" created="Thu, 22 Nov 2012 14:18:45 +0000"  >&lt;p&gt;It&apos;s in the query optimizer (src/mongo/db/queryoptimizer.cpp) line 314 in the commit &lt;a href=&quot;https://github.com/mongodb/mongo/commit/428bb865bfd24848ffba0fb9b9514264e5b3816e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/428bb865bfd24848ffba0fb9b9514264e5b3816e&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="196646" author="eliot" created="Thu, 22 Nov 2012 14:00:54 +0000"  >&lt;p&gt;Where do you see that constraint listed?&lt;br/&gt;
Hard without context, but sounds like it might not support $in yet, but don&apos;t see the message, so hard to tell.&lt;/p&gt;</comment>
                            <comment id="196632" author="remonvv" created="Thu, 22 Nov 2012 13:41:33 +0000"  >&lt;p&gt;@Eliot Awesome! I&apos;m certainly not an expert on how to implement database indexes so my suggestion to use counted b-trees wasn&apos;t based on an real life expertise. Just checked out the commits for 1752 and the specialized cursor for count queries that uses index value ranges looks like a much better solution. What is meant by the constraint that the field range vector should exactly represent a single interval in real world count queries?&lt;/p&gt;</comment>
                            <comment id="196607" author="eliot" created="Thu, 22 Nov 2012 12:58:56 +0000"  >&lt;p&gt;When 2.3.1 one comes out in a few days, would be great if you could try the counts and measure the difference.&lt;br/&gt;
Just remember 2.3.1 is unstable, so shouldn&apos;t be used for production.&lt;/p&gt;</comment>
                            <comment id="196605" author="eliot" created="Thu, 22 Nov 2012 12:57:20 +0000"  >&lt;p&gt;I don&apos;t think counted b-trees make sense for a variety of reasons (concurrency, space, performance) and do not think any database uses them (could be wrong, but research hasn&apos;t found a single one).&lt;/p&gt;

&lt;p&gt;In 2.4, we&apos;ve improved the algorithm for counting which has dramatically improved the performance of many counts where this would help.&lt;/p&gt;

&lt;p&gt;See &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1752&quot; title=&quot;improve the performance of simple counts&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1752&quot;&gt;&lt;del&gt;SERVER-1752&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="13036">SERVER-1752</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>11.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 22 Nov 2012 12:57:20 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            11 years, 8 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_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>remonvv</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrngrb:</customfieldvalue>

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

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

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