<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:37:31 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-78124] add query count in getPlanCache list, this can help us to get the hot query sql</title>
                <link>https://jira.mongodb.org/browse/SERVER-78124</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;now,we can not get the hot query sql.&lt;/p&gt;


&lt;p&gt;after add query count, wo can get the hot qeury, this can help us to analysis the hot sql priority .&lt;/p&gt;

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

&lt;p&gt;In addition, after add the statistics, we can centralized optimize hot sql index problem.&#160;&lt;/p&gt;

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

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

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

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

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="2369355">SERVER-78124</key>
            <summary>add query count in getPlanCache list, this can help us to get the hot query sql</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="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="1147952115@qq.com">y yz</reporter>
                        <labels>
                            <label>query-product-scope-2</label>
                            <label>query-product-urgency-3</label>
                            <label>query-product-value-3</label>
                            <label>scope</label>
                    </labels>
                <created>Thu, 15 Jun 2023 14:45:32 +0000</created>
                <updated>Sun, 15 Oct 2023 13:05:01 +0000</updated>
                                                                                                <votes>0</votes>
                                    <watches>9</watches>
                                                                                                                <comments>
                            <comment id="5779644" author="1147952115@qq.com" created="Sun, 15 Oct 2023 13:05:01 +0000"  >&lt;p&gt;hi,&#160;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=colby.ing%40mongodb.com&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;Colby Ing&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;got it, Thank you very much for your reply.&lt;/p&gt;</comment>
                            <comment id="5776570" author="JIRAUSER1264467" created="Fri, 13 Oct 2023 14:38:17 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=1147952115%40qq.com&quot; class=&quot;user-hover&quot; rel=&quot;1147952115@qq.com&quot;&gt;1147952115@qq.com&lt;/a&gt; - we have a feature coming soon that satisfies this requirement - you can find the documentation &lt;a href=&quot;https://www.mongodb.com/docs/upcoming/reference/operator/aggregation/queryStats/#mongodb-pipeline-pipe.-queryStats&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;. This should make its way into our self-hosted binaries in the 8.0 release (Mid 2024), does that timeframe work for you? We put this ticket on our backlog, but our team currently does not have the bandwidth to fully test and analyze the code in your PR. Even though it&apos;s a small PR, we have to reason about the concurrency model in our plan cache, and determine if it&apos;s compatible, which adds a lot of complexity. We will consider this in our future planning.&lt;/p&gt;

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

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;Colby&lt;/p&gt;</comment>
                            <comment id="5775627" author="1147952115@qq.com" created="Fri, 13 Oct 2023 07:17:45 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=colby.ing%40mongodb.com&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;hi, Colby Ing&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Do we have the conclusion of this PR(&lt;b&gt;requirement 2.&lt;/b&gt;)? Thank you.&lt;/p&gt;

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

&lt;p&gt;thanks.&lt;/p&gt;</comment>
                            <comment id="5616272" author="1147952115@qq.com" created="Mon, 7 Aug 2023 05:38:50 +0000"  >&lt;p&gt;hi&#65292;&#160;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=colby.ing%40mongodb.com&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;Colby Ing&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yes, these are what we really want.&lt;/p&gt;

&lt;p&gt;thanks.&lt;/p&gt;</comment>
                            <comment id="5614319" author="JIRAUSER1264467" created="Fri, 4 Aug 2023 18:22:59 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=1147952115%40qq.com&quot; class=&quot;user-hover&quot; rel=&quot;1147952115@qq.com&quot;&gt;1147952115@qq.com&lt;/a&gt;, thanks - I think I have a better understanding of what you want to do. Ideally - you would like to:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Analyze slow queries and look at execution details to see why that query is slow, perhaps you used a wrong index, or no index at all.&lt;/li&gt;
	&lt;li&gt;For those queries that used the wrong index, you would like to force a certain index to that query.&lt;/li&gt;
	&lt;li&gt;Additionally, you would like to get a sense of how big the problem is, by looking at how many queries used that sub-optimal plan. For all queries, you would like to view queries that have high counts.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Please let me know if I&apos;ve captured the requirements correctly.&lt;/p&gt;

&lt;p&gt;We do have a roadmap that addresses many of these use-cases - mainly to be able to analyze query plans and how many times those query plans have been run. Happy to set up a call to talk about you use-case!&lt;/p&gt;

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

&lt;p&gt;Thank you,&lt;/p&gt;

&lt;p&gt;Colby&lt;/p&gt;</comment>
                            <comment id="5601790" author="1147952115@qq.com" created="Mon, 31 Jul 2023 13:43:10 +0000"  >&lt;p&gt;hi,&#160;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=colby.ing%40mongodb.com&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;Colby Ing&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you for your reply. I am sorry that I did not describe this PR clearly.&lt;br/&gt;
There are actually two requirements here:&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Requirement 1: get hot sql. (not for this PR)&lt;/b&gt;&lt;br/&gt;
Same kind of query sql count statistics, a kind of query sql count =query1 that&#160; use collScan + query2 that not cached in PlanCache list(only one candidate index) + query3 that cached in PlanCache list(At least two candidate index).&lt;/p&gt;

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

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

&lt;p&gt;&lt;b&gt;Requirement 2:&#160; add count statistics in plancache list, with other stastics(for example, works&#12289;createdFromQuery&#12289;creationExecStats) to help us to analysis candidate index problem and its influence. (for this PR)&lt;/b&gt;&lt;br/&gt;
1. in online MongoDB cluster, sometimes the sql will run out, the sql selected the wrong index(not best index), so we periodically get the PlanCache list of the corresponding collection every few seconds to analyze the reason. In addition, we shold stastic the query affected during use the wrong index&#65292;so we want to know how many queries are affected when use the wrong index.&lt;/p&gt;

&lt;p&gt;2. According to the online mongodb statistics, most of the SQL that needs index optimization online is the SQL that has two or more candidate indexes. sometimes, there are many different kind of query sql, so we&#160; need to reference plancache list to carry out high-priority index optimization for this part of SQL.&lt;/p&gt;

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

&lt;p&gt;this PR is mainly for the second scenariofor, &lt;b&gt;requirement 2.&lt;/b&gt;&lt;/p&gt;</comment>
                            <comment id="5598189" author="JIRAUSER1264467" created="Fri, 28 Jul 2023 13:21:55 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=1147952115%40qq.com&quot; class=&quot;user-hover&quot; rel=&quot;1147952115@qq.com&quot;&gt;1147952115@qq.com&lt;/a&gt;,&#160;&lt;/p&gt;

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

&lt;p&gt;Thank you so much for taking the time to look into this and coming up with a solution. We currently have a feature in development that addresses this use-case. This feature will give you the ability to look at frequently run queries, so you can understand which queries need optimization. I&apos;m happy to schedule a call with you and your team to discuss any details!&lt;/p&gt;</comment>
                            <comment id="5550380" author="JIRAUSER1265262" created="Fri, 7 Jul 2023 13:57:06 +0000"  >&lt;p&gt;Once again, thanks for the PR! Your contributions are appreciated. I&apos;ll pass this to the relevant team to look at the suggested plan cache changes.&lt;/p&gt;</comment>
                            <comment id="5501816" author="1147952115@qq.com" created="Thu, 15 Jun 2023 14:56:57 +0000"  >&lt;p&gt;the optimize code address:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/pull/1556&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/pull/1556&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5501808" author="1147952115@qq.com" created="Thu, 15 Jun 2023 14:55:35 +0000"  >&lt;p&gt;We have such a problem&#65292; When there are a lot of sql&#160; queries,&#160; some query have&#160; more than one candidate index,and have many slow log&#65292; maybe index problem, we don&apos;t know which index shold be priority optimize.&lt;/p&gt;

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

&lt;p&gt;add the counters, we can get hot sql that have multiple candidate index and have inde problem, this may be useful.&lt;/p&gt;</comment>
                            <comment id="5501773" author="1147952115@qq.com" created="Thu, 15 Jun 2023 14:48:47 +0000"  >&lt;p&gt;befor getPlanCache().list(), as following&#65306;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/attachment/456538/456538_image-2023-06-15-22-46-52-763.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;

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

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

&lt;p&gt;after add statistics, as following&#65306;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/attachment/456539/456539_image-2023-06-15-22-48-44-889.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="456538" name="image-2023-06-15-22-46-52-763.png" size="26527" author="1147952115@qq.com" created="Thu, 15 Jun 2023 14:46:54 +0000"/>
                            <attachment id="456539" name="image-2023-06-15-22-48-44-889.png" size="29318" author="1147952115@qq.com" created="Thu, 15 Jun 2023 14:48:46 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>11.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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 7 Jul 2023 13:57:06 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        16 weeks, 3 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>1147952115@qq.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            16 weeks, 3 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-query-execution</customfieldvalue>
            <customfieldvalue>chris.kelly@mongodb.com</customfieldvalue>
            <customfieldvalue>colby.ing@mongodb.com</customfieldvalue>
            <customfieldvalue>1147952115@qq.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2e2an:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1w9hc:</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_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                    <customfieldvalue><![CDATA[chris.kelly@mongodb.com]]></customfieldvalue>
    

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2dofz:</customfieldvalue>

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