<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:05:28 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-44258] Pipeline::optimize() does not split a $match with an $or with a single child</title>
                <link>https://jira.mongodb.org/browse/SERVER-44258</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;As part of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-36723&quot; title=&quot;$limit should push down into the PlanStage layer, rather than coalescing with DocumentSourceCursor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-36723&quot;&gt;&lt;del&gt;SERVER-36723&lt;/del&gt;&lt;/a&gt;, a second call to optimizePipeline() was removed as the original intent for doing this was only to absorb a $limit which is no longer necessary. However this introduced a more subtle behavior change, since our &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/pipeline/pipeline.cpp#L280-L292&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;pipeline optimization code&lt;/a&gt; first attempts to re-order/split stages and then optimizes each individual stage. In the case where a $match has a $or with one child, the second phase will remove the $or altogether. There&apos;s a chance that the new $match without the $or can be split and moved ahead of a prior stage, which coincidentally will happen on the second call to optimizePipeline(). &lt;/p&gt;</description>
                <environment></environment>
        <key id="979519">SERVER-44258</key>
            <summary>Pipeline::optimize() does not split a $match with an $or with a single child</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="nicholas.zolnierz@mongodb.com">Nicholas Zolnierz</reporter>
                        <labels>
                            <label>afz</label>
                            <label>qopt-team</label>
                    </labels>
                <created>Fri, 25 Oct 2019 20:48:13 +0000</created>
                <updated>Tue, 6 Dec 2022 02:43:41 +0000</updated>
                                                                                                <votes>1</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="2755388" author="nicholas.zolnierz" created="Thu, 23 Jan 2020 17:17:05 +0000"  >&lt;p&gt;We should consider closing the linked BFs if they can&apos;t happen anymore, since it looks like the build baron team has been incorrectly marking many multiversion failures as dups (e.g. I just re-opened BF-16031).&#160;&lt;/p&gt;</comment>
                            <comment id="2755346" author="david.storch" created="Thu, 23 Jan 2020 16:55:54 +0000"  >&lt;p&gt;I don&apos;t have time to pursue this ticket further, so I&apos;m sending it to the Query Optimization team for triage. Note that the linked build failures can no longer happen due to the quick fix for this issue already merged under this ticket: &lt;a href=&quot;https://github.com/mongodb/mongo/commit/5c4c0d968ad72f05c768d553a49ac73e0ddb41f9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/5c4c0d968ad72f05c768d553a49ac73e0ddb41f9&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="2659753" author="xgen-internal-githook" created="Sat, 21 Dec 2019 14:32:13 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Charlie Swanson&apos;, &apos;email&apos;: &apos;charlie.swanson@mongodb.com&apos;, &apos;username&apos;: &apos;cswanson310&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-45284&quot; title=&quot;Temporarily workaround SERVER-44258  to stop build failures&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-45284&quot;&gt;&lt;del&gt;SERVER-45284&lt;/del&gt;&lt;/a&gt; Temporarily workaround &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-44258&quot; title=&quot;Pipeline::optimize() does not split a $match with an $or with a single child&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-44258&quot;&gt;SERVER-44258&lt;/a&gt; to stop build failures&lt;/p&gt;

&lt;p&gt;This is a quick and dirty fix to stop some tests from failing while we&lt;br/&gt;
develop a more robust fix.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/5c4c0d968ad72f05c768d553a49ac73e0ddb41f9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/5c4c0d968ad72f05c768d553a49ac73e0ddb41f9&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2585874" author="ted.tuckman" created="Thu, 5 Dec 2019 14:59:20 +0000"  >&lt;p&gt;Putting back on the backlog as I am out tomorrow and we would like this fixed. This hasn&apos;t been worked on in a few weeks, but the last BF Friday I was in we could only come up with the naive solution:  Add an extra unconditional call to optimizePipeline in the aggregation case, but this really just undoes the work that Dave did in his patch. &lt;/p&gt;</comment>
                            <comment id="2526154" author="ted.tuckman" created="Fri, 8 Nov 2019 21:04:35 +0000"  >&lt;p&gt;Current state of the ticket: The problem with adding another call to optimize is that it breaks match in $lookup. $lookup removes stages if there are no variables &lt;a href=&quot;#L124]&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;here&lt;/a&gt;. If we optimize before this, it removes the match stage (and the rest of the pipeline in some tests. However, we need to have optimized before the match stage in order to split as expected.&lt;/p&gt;

&lt;p&gt;After discussion with James today, we decided to investigate whether we could change/modify the dep tracking to work around this. This is still a WIP.&lt;/p&gt;</comment>
                            <comment id="2506362" author="david.storch" created="Tue, 29 Oct 2019 13:23:33 +0000"  >&lt;p&gt;Would it be reasonable to fix this by having the $match splitting code call &lt;tt&gt;optimize()&lt;/tt&gt; on any &lt;tt&gt;DocumentSourceMatch&lt;/tt&gt; it finds before attempting the swap? I don&apos;t think we should swap the order of doing pipeline-level optimizations and stage-level optimizations, since they were designed to happen in a specific order. I&apos;d also hesitate to make the $match splitting code aware of the single-child &lt;tt&gt;$or&lt;/tt&gt; case, since that is the concern of &lt;tt&gt;MatchExpression::optimize()&lt;/tt&gt;.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </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>3.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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 29 Oct 2019 13:23:33 +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[]]></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>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_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>21.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-query-optimization</customfieldvalue>
            <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>nicholas.zolnierz@mongodb.com</customfieldvalue>
            <customfieldvalue>ted.tuckman@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hvyzsf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr2hef:</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="3287">Query 2019-12-16</customfieldvalue>
    <customfieldvalue id="3288">Query 2019-12-30</customfieldvalue>
    <customfieldvalue id="3289">Query 2020-01-13</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|hvym1r:</customfieldvalue>

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