<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:50:14 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-82773] Use only inclusive bounds for intervals in the optimizer</title>
                <link>https://jira.mongodb.org/browse/SERVER-82773</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;An intersecting bound is currently optimized by rewriting the intersection as only the overlapping interval. For example, &lt;tt&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1, 5&amp;#93;&lt;/span&gt; &#8743; &lt;span class=&quot;error&quot;&gt;&amp;#91;2, 6&amp;#93;&lt;/span&gt; =&amp;gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;2, 5&amp;#93;&lt;/span&gt;&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;When variables are involved, this gets trickier, especially if there&apos;s a mix of open (exclusive) and closed (inclusive) bounds. For example, &lt;tt&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;a, b&amp;#93;&lt;/span&gt; &#8743; (c, d)&lt;/tt&gt;. We end up representing this as something like &lt;tt&gt;(max(a, c), min(b, d)) U aux(a) U aux(b)&lt;/tt&gt;, where the &lt;tt&gt;aux&lt;/tt&gt; are just point-intervals to represent inclusion for when &lt;tt&gt;a &amp;gt; c&lt;/tt&gt; or &lt;tt&gt;b &amp;lt; d&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;Using aux values results in a complex-looking query. Instead, we should consider normalizing all bounds to one type of bound. Since our universes are finite, it makes sense to normalize on closed bounds, and convert all open bounds into closed bounds. For example, using &lt;tt&gt;e&lt;/tt&gt; to represent &quot;epsilon,&quot; the above intersection can be written as &lt;tt&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;max(a, c+e), min(b, d-e)&amp;#93;&lt;/span&gt;&lt;/tt&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2490361">SERVER-82773</key>
            <summary>Use only inclusive bounds for intervals in the optimizer</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="william.qian@mongodb.com">William Qian</reporter>
                        <labels>
                    </labels>
                <created>Fri, 3 Nov 2023 16:09:36 +0000</created>
                <updated>Thu, 9 Nov 2023 19:20:51 +0000</updated>
                                                                                                <votes>0</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="5858363" author="JIRAUSER1274148" created="Mon, 6 Nov 2023 19:12:15 +0000"  >&lt;p&gt;Let&apos;s keep it open for now until we decide whether/when/how to address this. Otherwise, we&apos;ll probably just forget.&lt;/p&gt;</comment>
                            <comment id="5858355" author="JIRAUSER1253388" created="Mon, 6 Nov 2023 19:10:07 +0000"  >&lt;p&gt;Agreed, should this be closed then?&lt;/p&gt;</comment>
                            <comment id="5857839" author="JIRAUSER1274148" created="Mon, 6 Nov 2023 17:01:39 +0000"  >&lt;p&gt;Oops yes those are meant to be intersections. Thanks for catching that.&lt;/p&gt;

&lt;p&gt;It&apos;s likely that this would be an optimization that works only for certain types. But since numbers and strings are incredibly common, this could still be fairly useful.&lt;/p&gt;

&lt;p&gt;Svilen&apos;s suggestion of parameterizing inclusivity and exclusivity would resolve this concern better.&lt;/p&gt;</comment>
                            <comment id="5857776" author="JIRAUSER1253388" created="Mon, 6 Nov 2023 16:52:20 +0000"  >&lt;p&gt;Would this require a way to increment or decrement a BSON value? How would we decrement BSON empty array [] for example, which would be a BSON object.&lt;/p&gt;

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

&lt;p&gt;The union example isn&apos;t completely accurate because unioning needs two primary intervals in case the input intervals don&apos;t overlap. So it&apos;d be primary1 U primary2 U aux1 U aux2. If we make it intersection it would make sense to me.&lt;/p&gt;</comment>
                            <comment id="5857770" author="JIRAUSER1274148" created="Mon, 6 Nov 2023 16:50:56 +0000"  >&lt;p&gt;An alternative suggested by &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=svilen.mihaylov%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;svilen.mihaylov@mongodb.com&quot;&gt;svilen.mihaylov@mongodb.com&lt;/a&gt; is parameterized inclusion/exclusion.&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>5.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>Mon, 6 Nov 2023 16:52:20 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        13 weeks, 2 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>joseph.kanaan@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            13 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-query-optimization</customfieldvalue>
            <customfieldvalue>matt.boros@mongodb.com</customfieldvalue>
            <customfieldvalue>william.qian@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2yspz:</customfieldvalue>

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

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