<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:20:57 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-49828] Call &quot;MatchExpression::optimize()&quot; on collection validator expressions</title>
                <link>https://jira.mongodb.org/browse/SERVER-49828</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Currently, collection validator expressions are not optimized. In theory, it would not be a breaking change to optimize these expressions as MatchExpression::optimize() produces a semantically equivalent expression. However, some work would need to be done to ensure that validation error generation works properly when optimize() gets called. More precisely, we would need to store two copies of the MatchExpression: the original and the optimized one. While the optimized one would be used for matching, the unoptimized one would be used to produce detailed validation errors. This extra copy of the original is necessary because the optimized expression is not guaranteed to match the original shape of the user-specified validator expression and would potentially produce an incorrect error.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1418018">SERVER-49828</key>
            <summary>Call &quot;MatchExpression::optimize()&quot; on collection validator expressions</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-query-optimization">Backlog - Query Optimization</assignee>
                                    <reporter username="mihai.andrei@mongodb.com">Mihai Andrei</reporter>
                        <labels>
                            <label>qopt-team</label>
                    </labels>
                <created>Thu, 23 Jul 2020 12:31:37 +0000</created>
                <updated>Tue, 6 Dec 2022 02:14:48 +0000</updated>
                                                                                                <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="3401700" author="mihai.andrei" created="Fri, 18 Sep 2020 20:16:06 +0000"  >&lt;p&gt;Well, the code which generates descriptive error messages runs under the assumption that the document failed to validate against the expression, so if the document does match the original validator expression, you will get a bogus error if you run the error generating code. The correct thing to do would be to add a check in the error generating code that verifies that the document fails to match against the original expression before generating an error. In the case that the document does match, you wouldn&apos;t provide any details, but this doesn&apos;t seem ideal at all since we should be generating descriptive errors for every failure. Given that it&apos;s theoretically possible to have different results for the optimized version and the original, I&apos;m skeptical of pursuing this change.&lt;/p&gt;</comment>
                            <comment id="3399451" author="david.percy" created="Thu, 17 Sep 2020 16:35:36 +0000"  >&lt;p&gt;What should happen in this scenario?&lt;br/&gt;
1. The optimized validator rejects a document.&lt;br/&gt;
2. We run the original to get an explanation.&lt;br/&gt;
3. The original accepts the document--it has no explanation for why it would be rejected.&lt;/p&gt;</comment>
                            <comment id="3399424" author="david.storch" created="Thu, 17 Sep 2020 16:18:43 +0000"  >&lt;p&gt;To elaborate on what Mihai said, simply calling optimize() on the validator would break the code we&apos;ve developed for producing detailed doc validation errors. However, doing so could hypothetically have a performance benefit. I doubt this work is high priority, but it seems worth at least keeping on the backlog.&lt;/p&gt;</comment>
                            <comment id="3399316" author="mihai.andrei" created="Thu, 17 Sep 2020 15:41:19 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=james.wahlin&quot; class=&quot;user-hover&quot; rel=&quot;james.wahlin&quot;&gt;james.wahlin&lt;/a&gt; I&apos;m going to update the description in a bit, but we will have to do something like what &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=david.percy&quot; class=&quot;user-hover&quot; rel=&quot;david.percy&quot;&gt;david.percy&lt;/a&gt; suggested where we have to store the optimized expression for matching and the unoptimized for producing errors because the optimized expression is not guaranteed to match the original shape of the user-specified validator expression.&lt;/p&gt;</comment>
                            <comment id="3399279" author="james.wahlin@10gen.com" created="Thu, 17 Sep 2020 15:31:28 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=david.storch&quot; class=&quot;user-hover&quot; rel=&quot;david.storch&quot;&gt;david.storch&lt;/a&gt;&#160;/ &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=mihai.andrei&quot; class=&quot;user-hover&quot; rel=&quot;mihai.andrei&quot;&gt;mihai.andrei&lt;/a&gt;&#160;can you provide an update on where this stands and update the description if needed? Is it the case that error reporting has been improved and expected to be sufficient if we start optimize the validator expression?&lt;/p&gt;</comment>
                            <comment id="3399198" author="david.storch" created="Thu, 17 Sep 2020 14:57:30 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=mihai.andrei&quot; class=&quot;user-hover&quot; rel=&quot;mihai.andrei&quot;&gt;mihai.andrei&lt;/a&gt; I&apos;m going to move this out of the doc validation project and into the triage queue. &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=james.wahlin&quot; class=&quot;user-hover&quot; rel=&quot;james.wahlin&quot;&gt;james.wahlin&lt;/a&gt; &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=charlie.swanson&quot; class=&quot;user-hover&quot; rel=&quot;charlie.swanson&quot;&gt;charlie.swanson&lt;/a&gt; is this something that should be triaged by the QO team?&lt;/p&gt;</comment>
                            <comment id="3348495" author="david.percy" created="Thu, 20 Aug 2020 04:45:37 +0000"  >&lt;p&gt;Another strategy would be to keep both the optimized and the original MatchExpression. If the optimized one fails, you can rerun the original to get the explanation.&lt;/p&gt;

&lt;p&gt;The problem with this idea is that sometimes optimize() does change the behavior of an expression. (For one example, it assumes $add is associative.) So in theory the original and optimized expressions could disagree: true vs false.&lt;/p&gt;</comment>
                    </comments>
                    <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="25126"><![CDATA[Query Optimization]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 20 Aug 2020 04:45:37 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 20 weeks, 5 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>alexander.golin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 20 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-query-optimization</customfieldvalue>
            <customfieldvalue>david.percy@mongodb.com</customfieldvalue>
            <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>james.wahlin@mongodb.com</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|hxw9yv:</customfieldvalue>

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

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

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