<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:12:46 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-46904] Efficiency of one $or branch during planning may not be representative of overall plan efficiency</title>
                <link>https://jira.mongodb.org/browse/SERVER-46904</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Related to &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-20616&quot; title=&quot;Plan ranker sampling from the beginning of a query&amp;#39;s execution can result in poor plan selection&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-20616&quot;&gt;SERVER-20616&lt;/a&gt;, but specific to plans which perform more than one index scan and not reliant on data skew/affinity.&#160;&#160;&lt;/p&gt;

&lt;p&gt;Consider the following scenario:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;A contained $or query shape of { &amp;lt;Common Predicates&amp;gt; , $or: [ 
{ &amp;lt;CLAUSE1&amp;gt; }
&lt;p&gt;, { &amp;lt;CLAUSE2&amp;gt; } ] }&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Predicate values for CLAUSE1 such that there are at least 101 matching documents&lt;/li&gt;
	&lt;li&gt;Indexes &lt;tt&gt;A&lt;/tt&gt; and &lt;tt&gt;B&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;CLAUSE1 (along with the pushed down Common Predicates) is perfectly served by index A (meaning a key scanned to doc returned ratio of 1).&#160; Similarly CLAUSE 2 plus Common Predicates is perfectly served by index B&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The optimizer will produce, at least, the following four plans:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;index A, index A&lt;/li&gt;
	&lt;li&gt;index A, index B&lt;/li&gt;
	&lt;li&gt;index B, index A&lt;/li&gt;
	&lt;li&gt;index B, index B&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Given the parameters above, we would expect the trial phase to terminate after 101 works/index keys are scanned.&#160; Assuming all plans test CLAUSE1 first (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-42090&quot; title=&quot;Make ordering of OR branches stable in query data access planning&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-42090&quot;&gt;&lt;del&gt;SERVER-42090&lt;/del&gt;&lt;/a&gt;), this means that plans 1 and 2 will score the same since they are evaluating the same index and spend the entire trial phase in the clause.&#160; The overall efficiency of the two plans will be very different though since a different index is used for CLAUSE2.&#160;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1276498">SERVER-46904</key>
            <summary>Efficiency of one $or branch during planning may not be representative of overall plan efficiency</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="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-query-optimization">Backlog - Query Optimization</assignee>
                                    <reporter username="christopher.harris@mongodb.com">Chris Harris</reporter>
                        <labels>
                            <label>bonsai</label>
                    </labels>
                <created>Mon, 16 Mar 2020 21:17:12 +0000</created>
                <updated>Thu, 18 May 2023 08:53:53 +0000</updated>
                                                                                                <votes>0</votes>
                                    <watches>17</watches>
                                                                                                                    <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="231382">SERVER-20616</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>0.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25126"><![CDATA[Query Optimization]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5002K00000krJGkQAM, 5006R00001pkqifQAA, 5006R00001s8IboQAE]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 47 weeks, 2 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/TSEXP-1758'>TSEXP-1758</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_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 47 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-query-optimization</customfieldvalue>
            <customfieldvalue>christopher.harris@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hx8w13:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr2ljb:</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_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|hx8iaf:</customfieldvalue>

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