<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:58:07 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-1812] Add the ability to get query results and the query plan in one call</title>
                <link>https://jira.mongodb.org/browse/SERVER-1812</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;.explain() on a query returns the query plan instead of the query itself. It would be nice to be able to get the query results and the execution plan. This would be useful from the shell, as well as from the APIs. SQL Server Management Studio, the GUI that comes with MS SQL 2k5/2k8/2k8R2 has this functionality and its very useful when debugging. It allows you to tweak a query and ensure that the result set did not change in addition to measuring performance.&lt;/p&gt;</description>
                <environment>All</environment>
        <key id="13128">SERVER-1812</key>
            <summary>Add the ability to get query results and the query plan in one call</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-execution">Backlog - Query Execution</assignee>
                                    <reporter username="zippy1981">Justin Dearing</reporter>
                        <labels>
                    </labels>
                <created>Mon, 20 Sep 2010 15:37:21 +0000</created>
                <updated>Tue, 6 Dec 2022 05:48:02 +0000</updated>
                                            <version>1.6.1</version>
                    <version>1.7.0</version>
                                                    <component>Performance</component>
                    <component>Querying</component>
                                        <votes>1</votes>
                                    <watches>19</watches>
                                                                                                                <comments>
                            <comment id="2352389" author="craig.homa" created="Wed, 31 Jul 2019 14:55:50 +0000"  >&lt;p&gt;Re-opening as future plans to improve sharded explain will make this an easy and useful improvement to implement.&lt;/p&gt;</comment>
                            <comment id="1741906" author="asya" created="Mon, 4 Dec 2017 19:16:34 +0000"  >&lt;p&gt;Closing since as of 3.4 significant amount of information about execution plan is available in the logs.&lt;/p&gt;</comment>
                            <comment id="1741902" author="asya" created="Mon, 4 Dec 2017 19:15:48 +0000"  >&lt;p&gt;We now support this since the logs for operations show the number of index keys affected.&lt;br/&gt;
Example:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;2017-12-04T14:12:23.343-0500 I COMMAND  [conn11] command test.lotsofindexes appName: &quot;MongoDB Shell&quot; command: insert { insert: &quot;lotsofindexes&quot;, documents: [ { _id: ObjectId(&apos;5a259e1763f82b808d8e53e1&apos;), a: 10.0, b: 20.0 } ], ordered: true, $db: &quot;test&quot; } ninserted:1 keysInserted:9 numYields:0 reslen:29 locks:{ Global: { acquireCount: { r: 1, w: 1 } }, Database: { acquireCount: { w: 1 } }, Collection: { acquireCount: { w: 1 } } } protocol:op_msg 12ms&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;This is a log line for single insert into a collection with nine indexes.  Note &lt;b&gt;&lt;tt&gt;keysInserted:9&lt;/tt&gt;&lt;/b&gt; field. &lt;/p&gt;
</comment>
                            <comment id="18405" author="zippy1981" created="Tue, 21 Sep 2010 21:45:17 +0000"  >&lt;p&gt;insert().explain() Would serve several purposes: &lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;When triggers get implemented, there would potentially be more than &quot;insert row, write index1 write index2&quot; to explain. One would assume the trigger results would be explained too.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;If a user happens to have 50 indexes on a collection and wonder why my collection is slow, a user might run explain before looking at the number of indexes on my query. From a UX (or I guess Programmer/Admin eXperience) point of view, its a more intuitive way to figure out why inserts are slow.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;From a UX point of view, the programmer/admin expects to be able to see planner output from all atomic CRUD operations.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;It would be a good diagnostic tool if there ever was a bug whereby some inserts were not updating all indexes.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;It would lead to the next logical step of allowing you to profile stored javascript, the way you can profile the execution plan of a stored proc in SQL server. You could be able to provide a breakdown of the execution of each query in the javascript. Ditto for passing a multi statement script passed to eval().&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="18399" author="eliot" created="Tue, 21 Sep 2010 18:07:58 +0000"  >&lt;p&gt;explains don&apos;t really make sense on insert as you know its going to touch every index.&lt;br/&gt;
not really sure what you would have i to do&lt;/p&gt;</comment>
                            <comment id="18367" author="zippy1981" created="Tue, 21 Sep 2010 07:59:03 +0000"  >&lt;p&gt;Eliot,&lt;/p&gt;

&lt;p&gt;I&apos;ll dig more deeply into what SSMS does.&lt;/p&gt;

&lt;p&gt;Some things I just noticed now:&lt;/p&gt;

&lt;p&gt;1. I can do var foo = db.foo.find() and call explain on that after getting results. So this is already possible.&lt;br/&gt;
2. I can&apos;t call explain on an insert. I&apos;ll try updates in the morning. &lt;/p&gt;

&lt;p&gt;Let me do some more research/thinking about this before closing this ticket. Insert should definitely have an explain to list the indexes it adds, if its getting replicated, etc, etc. Then again how do you get that from an insert that isn&apos;t safe?&lt;/p&gt;</comment>
                            <comment id="18361" author="eliot" created="Tue, 21 Sep 2010 01:59:32 +0000"  >&lt;p&gt;Not sure what sql manager is doing - probably just doing the explain and the query separately.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="833803">SERVER-42104</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1448003">SERVER-50428</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="84947">SERVER-10448</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="833803">SERVER-42104</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>7.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25125"><![CDATA[Query Execution]]></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>Tue, 21 Sep 2010 01:59:32 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 28 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_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, 28 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>asya.kamsky@mongodb.com</customfieldvalue>
            <customfieldvalue>backlog-query-execution</customfieldvalue>
            <customfieldvalue>craig.homa@mongodb.com</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>zippy1981</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpeuv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr2gy7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6611</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_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|hrkyxb:</customfieldvalue>

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