<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:22:10 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-50246] $unionWith explain loses information from any stages in sub-pipeline which get absorbed into cursor stage</title>
                <link>https://jira.mongodb.org/browse/SERVER-50246</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When we explain a pipeline with mode &quot;executionStats&quot; or above, we first&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/6ec7b6ce8a2dfb46f5e76c7d031e8dd81e5375fd/src/mongo/db/query/explain.cpp#L811-L815&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;execute the pipeline to completion&lt;/a&gt;&#160;and then serialize the individual stages. If one of those stages is a $unionWith, then the first phase will target and optimize the sub-pipeline, absorbing any possible stages into the $cursor stage. When serialize() is subsequently called against the $unionWith to generate the &apos;stages&apos; element of explain, we do the same process again except we&apos;ve&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/6ec7b6ce8a2dfb46f5e76c7d031e8dd81e5375fd/src/mongo/db/pipeline/process_interface/shardsvr_process_interface.cpp#L153-L158&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;lost any stages which were pushed down into the $cursor/$mergeCursors&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1437981">SERVER-50246</key>
            <summary>$unionWith explain loses information from any stages in sub-pipeline which get absorbed into cursor stage</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="13201">Fixed</resolution>
                                        <assignee username="nicholas.zolnierz@mongodb.com">Nicholas Zolnierz</assignee>
                                    <reporter username="ted.tuckman@mongodb.com">Ted Tuckman</reporter>
                        <labels>
                            <label>qopt-team</label>
                    </labels>
                <created>Tue, 11 Aug 2020 12:53:23 +0000</created>
                <updated>Sun, 29 Oct 2023 22:04:34 +0000</updated>
                            <resolved>Tue, 8 Sep 2020 17:36:08 +0000</resolved>
                                                    <fixVersion>4.7.0</fixVersion>
                    <fixVersion>4.4.2</fixVersion>
                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="3397892" author="xgen-internal-githook" created="Wed, 16 Sep 2020 20:40:28 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Nick Zolnierz&apos;, &apos;email&apos;: &apos;nicholas.zolnierz@mongodb.com&apos;, &apos;username&apos;: &apos;nzolnierzmdb&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-50246&quot; title=&quot;$unionWith explain loses information from any stages in sub-pipeline which get absorbed into cursor stage&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-50246&quot;&gt;&lt;del&gt;SERVER-50246&lt;/del&gt;&lt;/a&gt; Fix $unionWith explain with mode &apos;executionStats&apos; to account for pushed down stages&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 4edfad49d10c3f75cf1fbc2f909e424d79f4a7e1)&lt;br/&gt;
Branch: v4.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/95f19f434bbbccba3723fe84c59f1644465a5a7a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/95f19f434bbbccba3723fe84c59f1644465a5a7a&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3380394" author="xgen-internal-githook" created="Tue, 8 Sep 2020 17:34:05 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Nick Zolnierz&apos;, &apos;email&apos;: &apos;nicholas.zolnierz@mongodb.com&apos;, &apos;username&apos;: &apos;nzolnierzmdb&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-50246&quot; title=&quot;$unionWith explain loses information from any stages in sub-pipeline which get absorbed into cursor stage&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-50246&quot;&gt;&lt;del&gt;SERVER-50246&lt;/del&gt;&lt;/a&gt; Fix $unionWith explain with mode &apos;executionStats&apos; to account for pushed down stages&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/4edfad49d10c3f75cf1fbc2f909e424d79f4a7e1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/4edfad49d10c3f75cf1fbc2f909e424d79f4a7e1&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3370740" author="nicholas.zolnierz" created="Tue, 1 Sep 2020 18:18:28 +0000"  >&lt;p&gt;Marking as related to &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-22622&quot; title=&quot;Improve $lookup explain to indicate query plan on the &amp;quot;from&amp;quot; collection&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-22622&quot;&gt;SERVER-22622&lt;/a&gt;, as they share a common theme of explaining pipelines which read/access multiple collections.&lt;/p&gt;</comment>
                            <comment id="3355789" author="nicholas.zolnierz" created="Mon, 24 Aug 2020 17:20:02 +0000"  >&lt;p&gt;Re-titled to describe the issue. When we explain a pipeline with mode &quot;executionStats&quot; or above, we first &lt;a href=&quot;https://github.com/mongodb/mongo/blob/6ec7b6ce8a2dfb46f5e76c7d031e8dd81e5375fd/src/mongo/db/query/explain.cpp#L811-L815&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;execute the pipeline to completion&lt;/a&gt; and then serialize the individual stages. If one of those stages is a $unionWith, then the first phase will target and optimize the sub-pipeline, absorbing any possible stages into the $cursor stage. When serialize() is subsequently called against the $unionWith, we do the same process again except we &lt;a href=&quot;https://github.com/mongodb/mongo/blob/6ec7b6ce8a2dfb46f5e76c7d031e8dd81e5375fd/src/mongo/db/pipeline/process_interface/shardsvr_process_interface.cpp#L153-L158&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;lose any stages which were pushed down&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In the test added by &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-49469&quot; title=&quot;explain executionStats for $unionWith incorrectly shows COLLSCAN for inner pipeline&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-49469&quot;&gt;&lt;del&gt;SERVER-49469&lt;/del&gt;&lt;/a&gt;, the sub-pipeline has a $match stage which is lost when $unionWith serialize() is called.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                        <issuelink>
            <issuekey id="1471538">SERVER-50895</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1832379">SERVER-58888</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1454852">SERVER-50597</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="265662">SERVER-22622</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1407909">SERVER-49469</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>2.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="18953"><![CDATA[v4.4]]></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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 24 Aug 2020 17:20:02 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 21 weeks 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_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>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 21 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <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|hxzoqf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hxmeh3:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="3614">Query 2020-09-07</customfieldvalue>
    <customfieldvalue id="3615">Query 2020-09-21</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|hxzazr:</customfieldvalue>

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