<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:38:43 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-78585] Multikey indexes will not cover past the array even when the array attribute is not projected</title>
                <link>https://jira.mongodb.org/browse/SERVER-78585</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When an array attribute is defined as part of a compound index it is not possible to cover queries for attributes on the index that extend past the multikey value even when the multikey attribute itself is not projected. As a result, to cover queries with compound indexes users must manually flatten the array attributes by denormalizing their data across multiple documents when attributes that extend beyond a multikey value are required (see example below).&lt;/p&gt;

&lt;p&gt;OLTP workloads are often write heavy and will use data in small bits and pieces. Efficiently modeling this data often requires small documents that can be easily grouped together for complex reads using indexes on attributes containing references to other related documents in the same collection. Indexing these reference attributes currently forces a fetch if the attributes contain more than one value, reducing the overall efficiency and performance of the system for this large class of OLTP workloads. To avoid the fetch users must denormalize their data, introducing potential for data anomalies and adding overhead for writes and updates.&lt;/p&gt;

&lt;p&gt;Another common access pattern that is negatively impacted would be range queries on attributes that could otherwise be filtered by a multikey attribute condition. Consider a collection of evets that have multiple tags. In order to find events that occurred within a time range a compound index must be created on &quot;created, tag&quot; instead of &quot;tag, created&quot;. Since the tag attribute is an array the fetch will be executed before the date range filter is applied. This creates an inefficient index lookup as the date condition must be applied before the tag condition which mandates a fetch. Leading the index with tag forces all docs matching that tag to be fetched then filtered by date which would in all likelihood be even worse unless the tag values are sparse.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2381686">SERVER-78585</key>
            <summary>Multikey indexes will not cover past the array even when the array attribute is not projected</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="13204">Community Answered</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="rick.houlihan@mongodb.com">Rick Houlihan</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Jun 2023 18:43:35 +0000</created>
                <updated>Fri, 27 Oct 2023 15:56:24 +0000</updated>
                            <resolved>Fri, 30 Jun 2023 21:04:00 +0000</resolved>
                                    <version>7.0.0-rc6</version>
                                                                        <votes>3</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="5538080" author="rick.houlihan" created="Fri, 30 Jun 2023 21:04:01 +0000"  >&lt;p&gt;The query in question was not well formed. There is no issue.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</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_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        31 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>
                            31 weeks, 5 days ago
                        </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>rick.houlihan@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2g6cn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1yc5s:</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_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;Insert the following documents into a collection:&lt;/p&gt;

{ _id: &quot;P1&quot;, data: &quot;P1data&quot;, relatedTo: &quot;P1&quot; }

&lt;p&gt;,&lt;/p&gt;

{ _id: &quot;P2&quot;, data: &quot;P2data&quot;, relatedTo: &quot;P2&quot; }

&lt;p&gt;,&lt;/p&gt;

{ _id: &quot;C1&quot;, data: &quot;C1data&quot;, relatedTo: [&quot;P1&quot;, &quot;P2&quot;] }

&lt;p&gt;,&lt;/p&gt;

{ _id: &quot;C2&quot;, data: &quot;C2data&quot;, relatedTo: [&quot;P1&quot;, &quot;P2&quot;] }

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Add the following index:&lt;/p&gt;

&lt;p&gt;createIndex(&lt;/p&gt;

{ &quot;relatedTo&quot;: 1, &quot;data&quot;: 1 }

&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Note that following query is not covered by the index even though data is the only attribute projected:&lt;br/&gt;
find({relatedTo: &quot;P1&quot;}, {&quot;_id&quot;: 0, data:1})&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Create a new collection and add the following documents:&lt;/p&gt;

{ _id: &quot;P1&quot;, data: &quot;P1data&quot;, relatedTo: &quot;P1&quot; }

&lt;p&gt;,&lt;/p&gt;

{ _id: &quot;P2&quot;, data: &quot;P2data&quot;, relatedTo: &quot;P2&quot; }

&lt;p&gt;,&lt;/p&gt;

{ _id: &quot;C1&quot;, data: &quot;C1data&quot;, relatedTo: &quot;P1&quot;&#160;}

&lt;p&gt;,&lt;/p&gt;

{ _id: &quot;C1.1&quot;, data: &quot;C1data&quot;, relatedTo: &quot;P2&quot;]}

&lt;p&gt;,&lt;/p&gt;

{ _id: &quot;C2&quot;, data: &quot;C2data&quot;, relatedTo: &quot;P1&quot;&#160;}

&lt;p&gt;,&lt;/p&gt;

{ _id: &quot;C2.1&quot;, data: &quot;C2data&quot;, relatedTo: &quot;P2&quot; }

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Add the following index:&lt;/p&gt;

&lt;p&gt;createIndex(&lt;/p&gt;

{ &quot;relatedTo&quot;: 1, &quot;data&quot;: 1 }

&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;Note that the following query will be covered:&lt;br/&gt;
find({relatedTo: &quot;P1&quot;}, {&quot;_id&quot;: 0, data:1})&lt;/p&gt;</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|i2fshz:</customfieldvalue>

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