<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:40:39 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-35693] Parsing of $in takes quadratic time due to O(n^2) boost::flat_set constructor</title>
                <link>https://jira.mongodb.org/browse/SERVER-35693</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;As of the fix for&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-30189&quot; title=&quot;Reduce calls to allocator for large $in expressions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-30189&quot;&gt;&lt;del&gt;SERVER-30189&lt;/del&gt;&lt;/a&gt;, the &lt;tt&gt;$in&lt;/tt&gt; parsing code makes use of a &lt;tt&gt;boost::flat_set&lt;/tt&gt; in order to avoid the many small allocations required for a tree-based sorted set. This, however, results in O(n^2) worst-case time complexity for parsing an &lt;tt&gt;$in&lt;/tt&gt;, since the &lt;tt&gt;boost::flat_set&lt;/tt&gt; constructor is known to be quadratic:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://svn.boost.org/trac10/ticket/13140&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://svn.boost.org/trac10/ticket/13140&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For &lt;tt&gt;$in&lt;/tt&gt; predicates with many elements, this causes a substantial performance regression. It is observable in that a large &lt;tt&gt;$in&lt;/tt&gt; where the elements are pre-sorted outperforms a large &lt;tt&gt;$in&lt;/tt&gt; where the elements are random by orders of magnitude. (When the &lt;tt&gt;$in&lt;/tt&gt;&#160;elements are pre-sorted, the &lt;tt&gt;boost::flat_set&lt;/tt&gt; constructor always inserts at the end of its vector, resulting in O(n log n) runtime.)&lt;/p&gt;

&lt;p&gt;We should either patch boost to improve the &lt;tt&gt;boost::flat_set&lt;/tt&gt; constructor&apos;s performance, or work around the issue by pre-sorting the &lt;tt&gt;$in&lt;/tt&gt; elements prior to invoking the constructor.&lt;/p&gt;</description>
                <environment></environment>
        <key id="561704">SERVER-35693</key>
            <summary>Parsing of $in takes quadratic time due to O(n^2) boost::flat_set constructor</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.mongodb.org/images/icons/priorities/critical.svg">Critical - P2</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="13201">Fixed</resolution>
                                        <assignee username="david.storch@mongodb.com">David Storch</assignee>
                                    <reporter username="david.storch@mongodb.com">David Storch</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Jun 2018 20:59:46 +0000</created>
                <updated>Sun, 29 Oct 2023 22:30:36 +0000</updated>
                            <resolved>Thu, 21 Jun 2018 14:44:56 +0000</resolved>
                                    <version>3.2.19</version>
                    <version>3.4.9</version>
                    <version>3.6.5</version>
                    <version>4.0.0-rc6</version>
                                    <fixVersion>3.2.21</fixVersion>
                    <fixVersion>3.4.16</fixVersion>
                    <fixVersion>3.6.6</fixVersion>
                    <fixVersion>4.0.1</fixVersion>
                    <fixVersion>4.1.1</fixVersion>
                                    <component>Querying</component>
                                        <votes>0</votes>
                                    <watches>10</watches>
                                                                                                                <comments>
                            <comment id="1934809" author="xgen-internal-githook" created="Fri, 29 Jun 2018 14:20:49 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;dstorch&apos;, &apos;name&apos;: &apos;David Storch&apos;, &apos;email&apos;: &apos;david.storch@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-35693&quot; title=&quot;Parsing of $in takes quadratic time due to O(n^2) boost::flat_set constructor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-35693&quot;&gt;&lt;del&gt;SERVER-35693&lt;/del&gt;&lt;/a&gt; Pre-sort $in elements to avoid O(n^2) boost::flat_set() complexity.&lt;/p&gt;

&lt;p&gt;(cherry picked from commit a6eae4759b792f86284006d475b00559fe96953c)&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/ad4bc1393facc1988ad86d021e47f9b2f0928a15&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/ad4bc1393facc1988ad86d021e47f9b2f0928a15&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1934223" author="xgen-internal-githook" created="Thu, 28 Jun 2018 19:54:57 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;dstorch&apos;, &apos;name&apos;: &apos;David Storch&apos;, &apos;email&apos;: &apos;david.storch@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-35693&quot; title=&quot;Parsing of $in takes quadratic time due to O(n^2) boost::flat_set constructor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-35693&quot;&gt;&lt;del&gt;SERVER-35693&lt;/del&gt;&lt;/a&gt; Pre-sort $in elements to avoid O(n^2) boost::flat_set() complexity.&lt;br/&gt;
Branch: v3.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/ed5dccdc3ffe74a869c04ee31c61e61da0b0d0c3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/ed5dccdc3ffe74a869c04ee31c61e61da0b0d0c3&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1929024" author="xgen-internal-githook" created="Fri, 22 Jun 2018 16:53:44 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;dstorch&apos;, &apos;name&apos;: &apos;David Storch&apos;, &apos;email&apos;: &apos;david.storch@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-35693&quot; title=&quot;Parsing of $in takes quadratic time due to O(n^2) boost::flat_set constructor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-35693&quot;&gt;&lt;del&gt;SERVER-35693&lt;/del&gt;&lt;/a&gt; Pre-sort $in elements to avoid O(n^2) boost::flat_set() complexity.&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 50c6a174e67cdef97b1877b5ce8916dc55725fd5)&lt;br/&gt;
Branch: v3.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/c50dd604f81a7464389ffa1ac5c7ba8f0b471d24&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/c50dd604f81a7464389ffa1ac5c7ba8f0b471d24&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1928694" author="xgen-internal-githook" created="Fri, 22 Jun 2018 14:24:26 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;dstorch&apos;, &apos;name&apos;: &apos;David Storch&apos;, &apos;email&apos;: &apos;david.storch@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-35693&quot; title=&quot;Parsing of $in takes quadratic time due to O(n^2) boost::flat_set constructor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-35693&quot;&gt;&lt;del&gt;SERVER-35693&lt;/del&gt;&lt;/a&gt; Pre-sort $in elements to avoid O(n^2) boost::flat_set() complexity.&lt;/p&gt;

&lt;p&gt;(cherry picked from commit a6eae4759b792f86284006d475b00559fe96953c)&lt;br/&gt;
Branch: v3.6&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/50c6a174e67cdef97b1877b5ce8916dc55725fd5&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/50c6a174e67cdef97b1877b5ce8916dc55725fd5&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1927485" author="xgen-internal-githook" created="Thu, 21 Jun 2018 14:43:20 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;dstorch&apos;, &apos;name&apos;: &apos;David Storch&apos;, &apos;email&apos;: &apos;david.storch@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-35693&quot; title=&quot;Parsing of $in takes quadratic time due to O(n^2) boost::flat_set constructor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-35693&quot;&gt;&lt;del&gt;SERVER-35693&lt;/del&gt;&lt;/a&gt; Pre-sort $in elements to avoid O(n^2) boost::flat_set() complexity.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/a6eae4759b792f86284006d475b00559fe96953c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/a6eae4759b792f86284006d475b00559fe96953c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1926754" author="david.storch" created="Wed, 20 Jun 2018 20:32:25 +0000"  >&lt;p&gt;The proposed fix for this ticket works around the issue in the query processing layer of the MongoDB server. In addition, we may wish to pursue a fix in the boost library itself. I have filed &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-35712&quot; title=&quot;boost::flat_set constructor should be O(n log n) given an unsorted range&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-35712&quot;&gt;&lt;del&gt;SERVER-35712&lt;/del&gt;&lt;/a&gt; to track this additional work.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="562027">SERVER-35699</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="514146">SERVER-34012</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="562195">SERVER-35712</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="606207">SERVER-37176</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="404851">SERVER-30189</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="15640"><![CDATA[v4.0]]></customfieldvalue>
    <customfieldvalue key="15141"><![CDATA[v3.6]]></customfieldvalue>
    <customfieldvalue key="14340"><![CDATA[v3.4]]></customfieldvalue>
    <customfieldvalue key="13440"><![CDATA[v3.2]]></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_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[500A000000b7qW1IAI, 500A000000bTGu3IAG, 500A000000bTH9mIAG, 500A000000bV9DQIA0, 500A000000bWHu0IAG, 500A000000bWHv3IAG, 500A000000bWIXgIAO, 500A000000bWJVgIAO, 500A000000bWJhNIAW, 500A000000bMHqkIAG, 500A000000bMHteIAG, 500A000000bMI6nIAG, 500A000000bMIKpIAO, 500A000000bMIYXIA4, 500A000000bMId8IAG, 500A000000bMIunIAG, 500A000000bROGFIA4, 500A000000bROPvIAO, 500A000000bROUCIA4, 500A000000bROXVIA4, 500A000000bSSSdIAO, 500A000000bSSdGIAW, 500A000000bSToFIAW, 500A000000bw0OsIAI, 500A000000bw0VjIAI, 500A000000bw0XaIAI, 500A000000bw0Z7IAI, 500A000000bwopkIAA, 500A000000bwouVIAQ, 500A000000bwovxIAA, 500A000000bwsf5IAA, 500A000000bwshkIAA, 500A000000bwsiOIAQ, 500A000000bwsk0IAA, 500A000000bxpgGIAQ, 500A000000bxq7WIAQ, 500A000000bxqGdIAI, 500A000000bxqjuIAA, 500A000000bxqqbIAA]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 21 Jun 2018 14:43:20 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            5 years, 32 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</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>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hu10f3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htru7r:</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>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="2382">Query 2018-07-02</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|hu0mof:</customfieldvalue>

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