<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:58:25 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-21784] Track &apos;nReturned&apos; and &apos;executionTimeMillis&apos; execution stats for each aggregation pipeline stage and expose via explain</title>
                <link>https://jira.mongodb.org/browse/SERVER-21784</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;For the same reason explain exists for .find(), it would be helpful to know how long an aggregation pipeline takes to run and within each stage.  In many ways it is even more important with .aggregate() because of potentially multiple pipeline expressions for the same result.  &lt;/p&gt;</description>
                <environment></environment>
        <key id="242558">SERVER-21784</key>
            <summary>Track &apos;nReturned&apos; and &apos;executionTimeMillis&apos; execution stats for each aggregation pipeline stage and expose via explain</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="mihai.andrei@mongodb.com">Mihai Andrei</assignee>
                                    <reporter username="matt.kalan@mongodb.com">Matt Kalan</reporter>
                        <labels>
                            <label>former-quick-wins</label>
                            <label>qopt-team</label>
                            <label>storch</label>
                            <label>usability</label>
                    </labels>
                <created>Mon, 7 Dec 2015 15:50:12 +0000</created>
                <updated>Mon, 7 Sep 2020 14:49:28 +0000</updated>
                            <resolved>Mon, 2 Dec 2019 19:55:27 +0000</resolved>
                                                    <fixVersion>4.3.3</fixVersion>
                                    <component>Aggregation Framework</component>
                                        <votes>25</votes>
                                    <watches>27</watches>
                                                                                                                <comments>
                            <comment id="2575335" author="xgen-internal-githook" created="Mon, 2 Dec 2019 19:50:01 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Mihai Andrei&apos;, &apos;email&apos;: &apos;mihai.andrei@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-21784&quot; title=&quot;Track &amp;#39;nReturned&amp;#39; and &amp;#39;executionTimeMillis&amp;#39; execution stats for each aggregation pipeline stage and expose via explain&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-21784&quot;&gt;&lt;del&gt;SERVER-21784&lt;/del&gt;&lt;/a&gt; Track &apos;nReturned&apos; and &apos;executionTimeMillis&apos; execution stats for each aggregation pipeline stage and expose via explain&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/159d19b1d3b0164d0096ce225f987da4610cc5db&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/159d19b1d3b0164d0096ce225f987da4610cc5db&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2094565" author="asya" created="Tue, 18 Dec 2018 16:52:53 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=mattmessmer&quot; class=&quot;user-hover&quot; rel=&quot;mattmessmer&quot;&gt;mattmessmer&lt;/a&gt; sorry about delay responding - explain(true) on aggregation in the current version &lt;b&gt;should&lt;/b&gt; show you how many documents are being sent through the pipeline already.  Without knowing exact aggregation you are trying to test I can&apos;t be 100% certain though.&lt;/p&gt;</comment>
                            <comment id="2005512" author="mattmessmer" created="Mon, 17 Sep 2018 19:41:37 +0000"  >&lt;p&gt;I&apos;m also hoping for this to be implemented.&lt;/p&gt;

&lt;p&gt;My current use case is comparing a distinct query to an aggregate query with a `$limit`. I&apos;m hoping the aggregate has to iterate over fewer keys/documents, but I can&apos;t prove this without this information. Thanks!&lt;/p&gt;</comment>
                            <comment id="1960742" author="asya" created="Mon, 30 Jul 2018 20:28:29 +0000"  >&lt;p&gt;I gave a talk about this last year - probably the most detailed version of it was in Europe Nov &apos;17 and Sydney March &apos;18, I couldn&apos;t find a recording but the slides and all the code I used are in a github repo, here&apos;s one of the decks: &lt;a href=&quot;https://github.com/asya999/mdbw17/blob/master/Sydney%20MDB.local.pdf&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/asya999/mdbw17/blob/master/Sydney%20MDB.local.pdf&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1960446" author="chris.lusby@macquarie.com" created="Mon, 30 Jul 2018 17:09:00 +0000"  >&lt;p&gt;That&apos;s really useful information thanks Asya &#8211; is this documented in the online docs somewhere, along with other optimisations that we should be aware of?&lt;/p&gt;</comment>
                            <comment id="1960422" author="asya" created="Mon, 30 Jul 2018 16:59:28 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=chris.lusby%40macquarie.com&quot; class=&quot;user-hover&quot; rel=&quot;chris.lusby@macquarie.com&quot;&gt;chris.lusby@macquarie.com&lt;/a&gt;&lt;br/&gt;
Thanks for you feedback.&lt;/p&gt;

&lt;p&gt;We definitely would like to expose more details about the full pipeline in explain, however,  I want to point out some misconceptions in your &quot;for instance&quot; bullet points - adding $project to reduce size of pipeline is not necessary as the pipeline itself will optimize the documents flowing through it to only the fields it will need in later stages.  $unwind also does not contribute to the 100MBs limit.  The only stages that can exceed the 100MBs limit are &quot;blocking&quot; stages ($sort that&apos;s not supported by an index, and $group, as well as $graphLookup which is special), all other stages are processed in a streaming fashion and cannot exceed that limit.&lt;/p&gt;

&lt;p&gt;Asya&lt;/p&gt;</comment>
                            <comment id="1952446" author="chris.lusby@macquarie.com" created="Fri, 20 Jul 2018 16:34:02 +0000"  >&lt;p&gt;This would be &lt;b&gt;extremely&lt;/b&gt; useful information.&lt;/p&gt;

&lt;p&gt;Given constraints within the aggregation pipeline (eg 100MB limits), certain operations might really impact the performance of the aggregation. In order to tune this, we need information such as:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;execution time&lt;/li&gt;
	&lt;li&gt;number of documents&lt;/li&gt;
	&lt;li&gt;data size (contributing to the 100MB)&lt;/li&gt;
	&lt;li&gt;etc&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;For instance:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;After a $match, we know we want to ordinarily $project down to a minimal set of fields. Knowing the impact of this is very useful&lt;/li&gt;
	&lt;li&gt;After an $unwind, we know the set of docs in the pipeline is exploded which can really impact the query. Again this is very useful&lt;/li&gt;
&lt;/ul&gt;


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

&lt;p&gt;Do we have an ETA for when this can begin development?&lt;/p&gt;</comment>
                            <comment id="1569031" author="david.storch" created="Thu, 11 May 2017 15:28:12 +0000"  >&lt;p&gt;Note that this has been partially implemented in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-19758&quot; title=&quot;Add &amp;quot;executionStats&amp;quot; and &amp;quot;allPlansExecution&amp;quot; explain modes to aggregation explain&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-19758&quot;&gt;&lt;del&gt;SERVER-19758&lt;/del&gt;&lt;/a&gt;, which allows aggregation explain to accept the &lt;tt&gt;executionStats&lt;/tt&gt; and &lt;tt&gt;allPlansExecution&lt;/tt&gt; explain modes. These new modes surface execution information, but for the &lt;tt&gt;$cursor&lt;/tt&gt; aggregation stage only. The remaining work to do on this ticket is to add execution stats tracking to all other aggregation stages, and to expose this information in the &lt;tt&gt;executionStats&lt;/tt&gt; or &lt;tt&gt;allPlansExecution&lt;/tt&gt; level explain output.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="224125">SERVER-19758</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="1031301">DRIVERS-799</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10320">
                    <name>Documented</name>
                                                                <inwardlinks description="is documented by">
                                        <issuelink>
            <issuekey id="1031300">DOCS-13259</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1359935">SERVER-48378</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1359943">SERVER-48380</issuekey>
        </issuelink>
                            </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>8.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_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10011"><![CDATA[Minor Change]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5002K00000j1hC0QAI, 5002K00000pFRqMQAW]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 11 May 2017 00:37:09 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 10 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/SERVER-19758'>SERVER-19758</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_17052" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Downstream Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>When running aggregate explain with verbosities &amp;quot;executionStats&amp;quot; and &amp;quot;allPlansExecution&amp;quot;, the output will include &amp;quot;nReturned&amp;quot; and &amp;quot;executionTimeMillisEstimate&amp;quot; for each aggregation stage.  </customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16942"><![CDATA[Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-766</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_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 10 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>asya.kamsky@mongodb.com</customfieldvalue>
            <customfieldvalue>chris.lusby@macquarie.com</customfieldvalue>
            <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>matt.kalan@mongodb.com</customfieldvalue>
            <customfieldvalue>mattmessmer</customfieldvalue>
            <customfieldvalue>mihai.andrei@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrkmvr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr6rgv:</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="3286">Query 2019-12-02</customfieldvalue>
    <customfieldvalue id="3287">Query 2019-12-16</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_17051" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Teams Impacted</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16943"><![CDATA[Cloud]]></customfieldvalue>
    <customfieldvalue key="16944"><![CDATA[Docs]]></customfieldvalue>
    <customfieldvalue key="16945"><![CDATA[Drivers]]></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|hrj0w7:</customfieldvalue>

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