<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:48:21 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-18653] Answering &quot;equality to null&quot; predicates with an index requires a FETCH stage</title>
                <link>https://jira.mongodb.org/browse/SERVER-18653</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I have a primary collection users:&lt;/p&gt;
{
  _id: ObjectId,
  follow: [ObjectId],
  primary: ObjectId
}

&lt;p&gt;primary field is optional in document&lt;br/&gt;
I have a non-sparse index:&lt;/p&gt;
{
  follow: 1,
  primary: 1
}

&lt;p&gt;When I try to query all followers without primary:&lt;br/&gt;
db.users.count(&lt;/p&gt;
{
  follow: ObjectId,
  primary: null
}
&lt;p&gt;)&lt;br/&gt;
it uses only follow field, fetches all these documents and then filters out documents where primary is null.&lt;/p&gt;

&lt;p&gt;Here is a result from explain:&lt;br/&gt;
&quot;winningPlan&quot; : {&lt;br/&gt;
    &quot;stage&quot; : &quot;COUNT&quot;, &lt;br/&gt;
    &quot;inputStage&quot; : {&lt;br/&gt;
        &quot;stage&quot; : &quot;FETCH&quot;, &lt;br/&gt;
        &quot;filter&quot; : {&lt;br/&gt;
            &quot;primary&quot; : &lt;/p&gt;
{
                &quot;$eq&quot; : null
            }
&lt;p&gt;        }, &lt;br/&gt;
        &quot;inputStage&quot; : {&lt;br/&gt;
            &quot;stage&quot; : &quot;IXSCAN&quot;, &lt;br/&gt;
            &quot;keyPattern&quot; : &lt;/p&gt;
{
                &quot;follow&quot; : NumberInt(1), 
                &quot;primary&quot; : NumberInt(1)
            }
&lt;p&gt;, &lt;br/&gt;
            &quot;indexName&quot; : &quot;follow_1_primary_1&quot;, &lt;br/&gt;
            &quot;isMultiKey&quot; : true, &lt;br/&gt;
            &quot;direction&quot; : &quot;forward&quot;, &lt;br/&gt;
            &quot;indexBounds&quot; : &lt;/p&gt;
{
                &quot;follow&quot; : [
                    &quot;[ObjectId(&apos;5382f987832983fb3a5ae9d4&apos;), ObjectId(&apos;5382f987832983fb3a5ae9d4&apos;)]&quot;
                ], 
                &quot;primary&quot; : [
                    &quot;[null, null]&quot;
                ]
            }
&lt;p&gt;        }&lt;br/&gt;
    }&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;It shows &apos;filter&apos; stage that absolutely not needed.&lt;br/&gt;
It drastically drops down a performance of an application.&lt;/p&gt;

&lt;p&gt;I checked that if I put primary as 0 - it works fine.&lt;br/&gt;
The problem is query with null value.&lt;/p&gt;</description>
                <environment></environment>
        <key id="206390">SERVER-18653</key>
            <summary>Answering &quot;equality to null&quot; predicates with an index requires a FETCH stage</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="backlog-query-optimization">Backlog - Query Optimization</assignee>
                                    <reporter username="andrey.hohutkin@gmail.com">Andrey Hohutkin</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 May 2015 09:02:41 +0000</created>
                <updated>Tue, 6 Dec 2022 04:50:52 +0000</updated>
                            <resolved>Wed, 3 Jun 2015 21:48:49 +0000</resolved>
                                    <version>3.0.3</version>
                                                    <component>Querying</component>
                                        <votes>0</votes>
                                    <watches>13</watches>
                                                                                                                <comments>
                            <comment id="1724742" author="mlis" created="Mon, 13 Nov 2017 23:59:09 +0000"  >&lt;p&gt;Hi, &lt;br/&gt;
For the last few weeks I have faced some serious performance issues as a result of null semantics in Mongodb, and this jira ticket currently appears to be the best source of information on mongo null semantics on the internet. Thus I apologise for flogging a dead horse, but I genuinely cannot find a better source of info.&lt;/p&gt;

&lt;p&gt;So firstly thank you both to andrey and @rassi for the super-useful information. It has been vital to my db performance.&lt;/p&gt;

&lt;p&gt;Simply put, I looked through the 2.6 changelist and this is the only documentation on &lt;b&gt;why&lt;/b&gt; the null-semantic change was made:&lt;/p&gt;

&lt;p&gt;&amp;gt; null equality conditions on array elements (e.g. &quot;a.b&quot;: null) no longer match document missing the nested field a.b (e.g. a: [ 2, 3 ])&lt;/p&gt;

&lt;p&gt;@rassi can you please provide any more info on &lt;b&gt;why&lt;/b&gt; this used to be indexed, and is no longer indexed? I think a lot of mongodb users out there would gain confidence in the engine if they had a better understanding of why the change was made.&lt;/p&gt;

&lt;p&gt;Thanks again,&lt;/p&gt;</comment>
                            <comment id="933746" author="andrey.hohutkin@gmail.com" created="Mon, 8 Jun 2015 11:17:45 +0000"  >&lt;p&gt;Because nobody replied to my comment I will create a ticket with a feature request.&lt;/p&gt;</comment>
                            <comment id="932802" author="andrey.hohutkin@gmail.com" created="Fri, 5 Jun 2015 17:06:26 +0000"  >&lt;p&gt;I want to show you that this issue has &quot;bad design&quot; and I will argue that.&lt;/p&gt;

&lt;p&gt;&quot;null&quot; is not reserved word or value for mongodb. It is value that used in documents as well as a lot of others like Number, String or ObjectId. So I can freely to use &quot;null&quot; value in db and expect that I can use full power of engine.&lt;/p&gt;

&lt;p&gt;Basing on this fact, I give you example that contains contradiction in it.&lt;br/&gt;
Let&apos;s create documents that have property &quot;primary&quot; and some of them can be null, others ObjectId or without property.&lt;br/&gt;
Let&apos;s create an index on this field only.&lt;br/&gt;
Now try to get count of documents with null value.&lt;br/&gt;
You will see that index is assumed to be used but not used.&lt;br/&gt;
You will get the same performance as you run it without index.&lt;br/&gt;
Do you agree that it is an absurd situation and should be resolved?&lt;/p&gt;

&lt;p&gt;Now I want to explain my opinion about your explanation how it works now.&lt;br/&gt;
You describe very special case that a document hypothetically can have an array. For this case and only for this case the whole engine should have a great performance slowdown? Without ability to query simple null value?&lt;/p&gt;

&lt;p&gt;I think, If a collection already has an index on specified field it should be ready for &quot;any&quot; case of data. Otherwise it is just takes a resources and does nothing.&lt;/p&gt;

&lt;p&gt;What is your opinion and what others think of it?&lt;br/&gt;
I will continue to investigate the issue. First part of it is easy with my patch. It uses index for any further operation.&lt;br/&gt;
After that, behavior of index should be changed and take a respect of array type to be sure that documents with array wont included into result.&lt;/p&gt;

&lt;p&gt;Thanks for attention.&lt;/p&gt;</comment>
                            <comment id="931817" author="rassi@10gen.com" created="Thu, 4 Jun 2015 17:44:28 +0000"  >&lt;p&gt;I will attempt to clearly spell out my previous explanation:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;The document {} generates the index key {&quot;&quot;: null} for the index with key pattern {&quot;a.b&quot;: 1}.&lt;/li&gt;
	&lt;li&gt;The document {a: []} also generates the index key {&quot;&quot;: null} for the index with key pattern {&quot;a.b&quot;: 1}.&lt;/li&gt;
	&lt;li&gt;The document {} matches the query {&quot;a.b&quot;: null}.&lt;/li&gt;
	&lt;li&gt;The document {a: []} does not match the query {&quot;a.b&quot;: null}.&lt;/li&gt;
	&lt;li&gt;Therefore, a query {&quot;a.b&quot;: null} that is answered by an index with key pattern {&quot;a.b&quot;: 1} must fetch the document and re-check the predicate, in order to ensure that the document {} is included in the result set and that the document {a: []} is not included in the result set.&lt;/li&gt;
&lt;/ol&gt;


&lt;blockquote&gt;
&lt;p&gt;You say that&lt;br/&gt;
&quot;this document {a: []} generates the index key {&quot;&quot;: null}.&quot;&lt;br/&gt;
It is a bug.&lt;br/&gt;
The key in index should be {&quot;a.b&quot;: null}&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Index keys don&apos;t have the field name attached, so the key is indeed {&quot;&quot;: null}.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;By documentation:&lt;br/&gt;
&quot;null equality queries (i.e. field: null ) now match fields with values undefined.&quot;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I was referring to the second bullet in this list, not the third bullet.  The second bullet reads as follows: &quot;null equality conditions on array elements (e.g. &apos;a.b&apos;: null) no longer match document missing the nested field a.b (e.g. a: [ 2, 3 ]).&quot;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;And finally the main issue - why it doesn&apos;t use an index?!!&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;As I mentioned above, this query is using an index, however the query cannot be covered by this index.&lt;/p&gt;</comment>
                            <comment id="931332" author="andrey.hohutkin@gmail.com" created="Thu, 4 Jun 2015 08:17:57 +0000"  >&lt;p&gt;Hi Jason!&lt;/p&gt;

&lt;p&gt;I do not agree with you that it &quot;Works as Designed&quot;.&lt;br/&gt;
&quot;primary&quot; field in DB is not mandatory, and more than that it should not to be in document because I build on it unique &quot;sparse&quot; index.&lt;br/&gt;
I dont want to increase index size by filling value with 0 or false or what ever.&lt;br/&gt;
In my case primary field (if it exists in document) should be ObjectId. So it is not logic to put &quot;false&quot; value in that case.&lt;/p&gt;

&lt;p&gt;Now I want to know how your explanation is related to my issue.&lt;br/&gt;
By documentation:&lt;br/&gt;
 &quot;null equality queries (i.e. field: null ) now match fields with values undefined.&quot;&lt;br/&gt;
It is exactly my case.&lt;/p&gt;

&lt;p&gt;According to spec &quot;undefined&quot; is deprecated.&lt;br/&gt;
And finally the main issue - why it doesn&apos;t use an index?!! Who cares &quot;null&quot; value on predication? If an index exists - give it to index to decide. If not - use fetch.&lt;/p&gt;

&lt;p&gt;IMHO, this is ridiculous, that a simple and clear issue not assumed as a bug.&lt;br/&gt;
If it &quot;works as designed&quot; it is bug by design.&lt;/p&gt;

&lt;p&gt;Please, reopen the issue or let someone else to say his opinion.&lt;/p&gt;

&lt;p&gt;P.S.&lt;br/&gt;
You say that&lt;br/&gt;
&quot;this document &lt;/p&gt;
{a: []}
&lt;p&gt; generates the index key &lt;/p&gt;
{&quot;&quot;: null}
&lt;p&gt;.&quot;&lt;br/&gt;
It is a bug.&lt;br/&gt;
The key in index should be &lt;/p&gt;
{&quot;a.b&quot;: null}</comment>
                            <comment id="931069" author="rassi@10gen.com" created="Wed, 3 Jun 2015 21:48:32 +0000"  >&lt;p&gt;Hi Andrey,&lt;/p&gt;

&lt;p&gt;I&apos;ve investigated further, and determined that this was in fact not a regression introduced in the 2.6 query engine rewrite, but instead was an intentional behavior change.&lt;/p&gt;

&lt;p&gt;Version 2.6.0 of the server changed the semantics of a null equality match predicate, such that the document {a: []} was no longer considered a match for the query predicate {&quot;a.b&quot;: null} (in prior versions of the server, this document was considered a match for this predicate).  This is documented in the 2.6 compatibility notes, under the &lt;a href=&quot;http://docs.mongodb.org/manual/release-notes/2.6-compatibility/#null-comparison-queries&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&quot;null comparison&quot; section&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For an index with key pattern {&quot;a.b&quot;: 1}, this document {a: []} generates the index key {&quot;&quot;: null}.  Other documents like {a: null} and the empty document {} also generate the index key {&quot;&quot;: null}.  As a result, if a query with predicate {&quot;a.b&quot;: null} uses this index, the query system cannot tell just from the index key {&quot;&quot;: null} whether or not the associated document matches the predicate.  As a result, INEXACT_FETCH bounds are assigned instead of EXACT bounds, and hence a FETCH stage is added to the query execution tree.&lt;/p&gt;

&lt;p&gt;As such, the existing code is correct, and I will close this ticket with resolution &quot;Works as Designed&quot;.  If you require an index-only count for this operation, you must implement a workaround in your application (for example, you could change your schema such that followers without a primary are represented by &quot;primary: false&quot; instead of &quot;primary: null&quot;).&lt;/p&gt;

&lt;p&gt;~ Jason Rassi&lt;/p&gt;</comment>
                            <comment id="928144" author="andrey.hohutkin@gmail.com" created="Sat, 30 May 2015 23:49:03 +0000"  >&lt;p&gt;I think I found a place with a bug.&lt;br/&gt;
Checking for null - is the main problem. No need to check for null at all.&lt;br/&gt;
Use full index even with null values (that legitimate).&lt;br/&gt;
Checked with sparse index and without. Working fine.&lt;br/&gt;
With sparse index it adds filter with primary field.&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;   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;diff -r 491e0354a29f src/mongo/db/query/index_bounds_builder.cpp&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;--- a/src/mongo/db/query/index_bounds_builder.cpp	Sat May 30 06:54:02 2015 +1000&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;+++ b/src/mongo/db/query/index_bounds_builder.cpp	Sun May 31 02:30:36 2015 +0300&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;@@ -825,7 +825,7 @@&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;             verify(dataObj.isOwned());&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;             oil-&amp;gt;intervals.push_back(makePointInterval(dataObj));&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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; &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;-            if (dataObj.firstElement().isNull() || isHashed) {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;+            if (isHashed) {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;                 *tightnessOut = IndexBoundsBuilder::INEXACT_FETCH;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;             }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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-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;             else {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                            <comment id="923606" author="rassi@10gen.com" created="Tue, 26 May 2015 17:08:38 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Thanks for the report.  I can confirm that this count operation should be able to use a covered scan on this index, but it does not.&lt;/p&gt;

&lt;p&gt;This appears to be a regression introduced by the query engine rewrite for the 2.6 release.  I can see that predicates of the form {a: null} (or {a: {$eq: null}}, equivalently) generate &quot;inexact bounds&quot; in cases where &quot;exact bounds&quot; could be generated.  This means that query plans in which these predicates are indexed will unnecessarily cause the document to be fetched and re-checked against the predicate (note that the index is indeed being used, but the query is not being covered by the index scan).&lt;/p&gt;

&lt;p&gt;I&apos;m updating the summary and moving this ticket to the &quot;Needs Triage&quot; state; please continue to watch this ticket for updates on when a fix may be scheduled.&lt;/p&gt;

&lt;p&gt;~ Jason Rassi&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="227255">SERVER-20155</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="209047">SERVER-18861</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>8.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>Tue, 26 May 2015 15:31:14 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        6 years, 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>alexander.golin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            6 years, 13 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>andrey.hohutkin@gmail.com</customfieldvalue>
            <customfieldvalue>backlog-query-optimization</customfieldvalue>
            <customfieldvalue>rassi</customfieldvalue>
            <customfieldvalue>mlis</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrl4yn:</customfieldvalue>

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

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