<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:22:36 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-10220] Support hashed fields in compound indexes and compound shard keys</title>
                <link>https://jira.mongodb.org/browse/SERVER-10220</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Provide ability to have hashed fields in compound indexes.  &lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;db.collection.ensureIndex({a : &apos;hashed&apos;, b : 1})&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Required for compound shard keys where one of the fields needs to be hashed for even distribution across the cluster.&lt;/p&gt;</description>
                <environment></environment>
        <key id="82391">SERVER-10220</key>
            <summary>Support hashed fields in compound indexes and compound shard keys</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="9">Done</resolution>
                                        <assignee username="backlog-server-sharding">[DO NOT USE] Backlog - Sharding Team</assignee>
                                    <reporter username="daniel.roberts@10gen.com">daniel.roberts@10gen.com</reporter>
                        <labels>
                            <label>indexing</label>
                            <label>sharding</label>
                    </labels>
                <created>Tue, 16 Jul 2013 09:54:06 +0000</created>
                <updated>Tue, 6 Dec 2022 05:19:39 +0000</updated>
                            <resolved>Thu, 23 Jan 2020 21:49:54 +0000</resolved>
                                                    <fixVersion>4.3.3</fixVersion>
                                    <component>Index Maintenance</component>
                    <component>Sharding</component>
                                        <votes>42</votes>
                                    <watches>48</watches>
                                                                                                                <comments>
                            <comment id="2756609" author="craig.homa" created="Thu, 23 Jan 2020 21:49:54 +0000"  >&lt;p&gt;Hey &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=louisa.berger&quot; class=&quot;user-hover&quot; rel=&quot;louisa.berger&quot;&gt;louisa.berger&lt;/a&gt;, this was done as part of the Compound Hashed Shard Key epic (PM-241), which will be included in 4.4. Please let the Query team know if you have any questions. &lt;/p&gt;

&lt;p&gt;CC &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=bernard.gorman&quot; class=&quot;user-hover&quot; rel=&quot;bernard.gorman&quot;&gt;bernard.gorman&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2756113" author="louisa.berger@10gen.com" created="Thu, 23 Jan 2020 21:20:15 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=craig.homa&quot; class=&quot;user-hover&quot; rel=&quot;craig.homa&quot;&gt;craig.homa&lt;/a&gt; Is this planning to be included in 4.4? &lt;/p&gt;</comment>
                            <comment id="1835759" author="john.page" created="Thu, 15 Mar 2018 21:00:42 +0000"  >&lt;p&gt;This also benefits from allow you to severely restrict the number of bits/range of values in the hash - so &lt;/p&gt;
{userid:&quot;Hashed:500&quot;}
&lt;p&gt; allowing to hash between 0 and 499.&lt;/p&gt;

&lt;p&gt;This avoids the issues with random values in btrees blowing out your I/O and also allows active management of chunk moves when provisioning new servers.&lt;/p&gt;</comment>
                            <comment id="953619" author="adamaflynn" created="Mon, 29 Jun 2015 20:25:26 +0000"  >&lt;p&gt;This feature is high on our wishlist as well. We have a number of collections that naturally shard by a key like user ID (ObjectId). In many of these collections, the number of documents per user is typically small but technically unbounded (often monotonically growing). The largest/oldest users in these cases can create jumbo chunks. &lt;/p&gt;

&lt;p&gt;To prevent these rare jumbo chunk cases, we need to add more granularity to the shard key, say _id. But since most writes happen for new users, we need &lt;tt&gt;user_id&lt;/tt&gt; to be hashed for even write distribution. So, our ideal shard key would be {&lt;tt&gt;user_id: &quot;hashed&quot;, _id: &quot;hashed&quot;&lt;/tt&gt;} or {&lt;tt&gt;user_id: &quot;hashed&quot;, _id: 1&lt;/tt&gt;} (limiting compound indexes to a single hashed key would be fine in this use case, since &lt;tt&gt;user_id&lt;/tt&gt; has enough cardinality that &lt;tt&gt;_id&lt;/tt&gt; won&apos;t materially impact write distribution).&lt;/p&gt;

&lt;p&gt;Right now, our workaround options are:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Use {&lt;tt&gt;user_id: &quot;hashed&quot;&lt;/tt&gt;} and hope we don&apos;t see jumbo chunks, which is obviously dangerous.&lt;/li&gt;
	&lt;li&gt;Use {&lt;tt&gt;user_id: 1, _id: 1&lt;/tt&gt;} and try to manage the hot chunks, which ranges from a small annoyance to unfeasible depending on write volume &amp;amp; distribution.&lt;/li&gt;
	&lt;li&gt;Use {&lt;tt&gt;hashed_user_id: 1, _id: 1&lt;/tt&gt;} and store a hash in the document, which turns &lt;tt&gt;user_id&lt;/tt&gt; queries into scatter/gathers (expensive at 40+ shards) or requires &lt;tt&gt;hashed_user_id&lt;/tt&gt; in every query spec (annoying to clutter the application with this, especially in cases fetching multiple users).&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Putting this feature in MongoDB would let us side-step a lot of jumbo chunk problems without a lot of application overhead or write distribution issues.&lt;/p&gt;</comment>
                            <comment id="928410" author="gjain@sprinklr.com" created="Mon, 1 Jun 2015 05:13:19 +0000"  >&lt;p&gt;Hi Mongo team,&lt;/p&gt;

&lt;p&gt;Any ETA on this?&lt;/p&gt;

&lt;p&gt;Thanks &amp;amp; regards,&lt;br/&gt;
Gagan&lt;/p&gt;</comment>
                            <comment id="693348" author="niccottrell" created="Mon, 18 Aug 2014 09:47:44 +0000"  >&lt;p&gt;I&apos;d love to have this field. I have a collection which is a corpus of extracted sentences. I have a &quot;t&quot; field which is a long text (&amp;gt;512) which often contains Arabic etc. so too long to have a normal index (with the new 1024 hard limit) but also a &quot;lc&quot; (language code) field. It would save a lot of BSON processing if I could have an index on &lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{t:&quot;hashed&quot;, lc:1}&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                                        </outwardlinks>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="95484">SERVER-11338</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="481624">SERVER-32657</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                                        </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_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25141"><![CDATA[Sharding]]></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[[5002K00000f1FOZQA2]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 18 Aug 2014 09:47:44 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 2 weeks, 6 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/PM-241'>PM-241</a></s>]]></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_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </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>alexander.golin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 2 weeks, 6 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>backlog-server-sharding</customfieldvalue>
            <customfieldvalue>adamaflynn</customfieldvalue>
            <customfieldvalue>craig.homa@mongodb.com</customfieldvalue>
            <customfieldvalue>daniel.roberts@10gen.com</customfieldvalue>
            <customfieldvalue>gjain@sprinklr.com</customfieldvalue>
            <customfieldvalue>john.page@mongodb.com</customfieldvalue>
            <customfieldvalue>louisa.berger@mongodb.com</customfieldvalue>
            <customfieldvalue>niccottrell</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrmmyf:</customfieldvalue>

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

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

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