<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:42:22 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-36202] when creating new index, use existing index if possible to avoid collection scan</title>
                <link>https://jira.mongodb.org/browse/SERVER-36202</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;A user pointed out that if there is an index on &lt;tt&gt;a:1, b:1&lt;/tt&gt;&#160; and they specify they want to create a new index &lt;tt&gt;b:1&lt;/tt&gt; with &lt;tt&gt;partialFilterExpression:{a:10&lt;/tt&gt;} (or any other filter on &lt;tt&gt;a&lt;/tt&gt; then index build could scan the existing index and build new index much faster.&lt;/p&gt;

&lt;p&gt;Common use case that can benefit from this may also be a case where there exists an index on &lt;tt&gt;a:1, b:1, c:1&lt;/tt&gt; and user wants to replace it with index on just &lt;tt&gt;a:1, b:1&lt;/tt&gt; which again can be build (hopefully) faster from existing index than collection scan.&lt;/p&gt;</description>
                <environment></environment>
        <key id="573734">SERVER-36202</key>
            <summary>when creating new index, use existing index if possible to avoid collection scan</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="12300">Won&apos;t Do</resolution>
                                        <assignee username="backlog-server-execution">Backlog - Storage Execution Team</assignee>
                                    <reporter username="asya.kamsky@mongodb.com">Asya Kamsky</reporter>
                        <labels>
                            <label>pmr</label>
                    </labels>
                <created>Thu, 19 Jul 2018 20:01:58 +0000</created>
                <updated>Mon, 4 Dec 2023 22:34:39 +0000</updated>
                            <resolved>Mon, 4 Dec 2023 22:34:39 +0000</resolved>
                                                                    <component>Index Maintenance</component>
                                        <votes>0</votes>
                                    <watches>11</watches>
                                                                                                                <comments>
                            <comment id="5924682" author="steven.vannelli" created="Mon, 4 Dec 2023 22:34:39 +0000"  >&lt;p&gt;The team discussed this in our Product Sync today and the group is comfortable closing this given the more specific linked tickets that have been created.&#160;&lt;/p&gt;</comment>
                            <comment id="3437324" author="louis.williams" created="Fri, 9 Oct 2020 17:17:42 +0000"  >&lt;p&gt;Due to the complexity of this task, I have broken it up into several tickets, linked. This ticket will stay open for watchers, but we are implementing the initial components of this change in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-51461&quot; title=&quot;Support building indexes from existing indexes guarded by feature flag&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-51461&quot;&gt;SERVER-51461&lt;/a&gt;, guarded by a feature flag.&lt;/p&gt;

&lt;p&gt;Aside from the filed tickets, &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-51461&quot; title=&quot;Support building indexes from existing indexes guarded by feature flag&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-51461&quot;&gt;SERVER-51461&lt;/a&gt; does not implement yielding, which will need to be addressed. &lt;/p&gt;</comment>
                            <comment id="3394912" author="daniel.gottlieb@10gen.com" created="Tue, 15 Sep 2020 16:44:34 +0000"  >&lt;p&gt;The third case should also improve in terms of a smaller memory footprint (avoiding the need to page in full documents).&lt;/p&gt;</comment>
                            <comment id="3394874" author="louis.williams" created="Tue, 15 Sep 2020 16:35:09 +0000"  >&lt;p&gt;I want to elaborate on these examples to clarify what would and would not be an improvement if we used an existing index build a new one.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Existing index on a:1, b:1, c:1. Creating a new index on a:1, b:1 or a: 1 or a:1, partialFilterExpression: b
	&lt;ul&gt;
		&lt;li&gt;This is definitely an improvement because we would not need to sort any keys. This eliminates one of the most expensive parts of the index build. I think this is a worthwhile improvement.&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Existing index on a:1. Creating a new index on b:1, a:1 or b:1 with partialFilterExpression on &apos;a&apos;
	&lt;ul&gt;
		&lt;li&gt;This will not be an improvement because we still have to read from the collection and sort keys for &apos;b&apos;. The addition of reading from the index will only add more time. Remember that an IXSCAN + FETCH is slower than a COLLSCAN&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Existing index on a:1, b:1. Creating a new index on b:1 or b:1 with partialFilterExpression on &apos;a&apos;
	&lt;ul&gt;
		&lt;li&gt;This &lt;em&gt;might&lt;/em&gt;&#160;be an improvement. We would still need to sort the keys for &apos;b&apos;. We wouldn&apos;t need to scan the collection to generate keys, but we would need scan the index to generate new keys. This improvement would have to come from avoiding key generation from BSON to KeyString, which is very highly optimized. We would have to show that key generation from an existing KeyString(a,b) -&amp;gt; KeyString(b) is significantly faster than BSON -&amp;gt; KeyString.&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="1377249">SERVER-48697</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="17541">SERVER-3150</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1508997">SERVER-51458</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1509001">SERVER-51459</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1509006">SERVER-51460</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1509008">SERVER-51461</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1509059">SERVER-51466</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>4.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_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25136"><![CDATA[Storage Execution]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 15 Sep 2020 16:35:09 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        9 weeks, 2 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>steven.vannelli@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            9 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>asya.kamsky@mongodb.com</customfieldvalue>
            <customfieldvalue>backlog-server-execution</customfieldvalue>
            <customfieldvalue>daniel.gottlieb@mongodb.com</customfieldvalue>
            <customfieldvalue>louis.williams@mongodb.com</customfieldvalue>
            <customfieldvalue>steven.vannelli@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hu30in:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr255z:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="4214">Execution Team 2020-10-05</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|hu2mrz:</customfieldvalue>

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