<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:05:12 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-4180] Allow multiple constraints (on same field) within a $elemMatch clause to be used with a multikey index</title>
                <link>https://jira.mongodb.org/browse/SERVER-4180</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;While bumping from 1.8 to mongo 2.0.1, we noticed some query optimization seemed not to work anymore. After some laborious digging in our data, we found out a single document showing the issue.&lt;/p&gt;

&lt;p&gt;Please open the attached .tgz. The tc.sh script will restore the document in a core.picture_set_pictures collection on a localhost:27017 mongo, setup an index, and explain a range query on a date embedded in a array of objects. The relevant section of the output shows.&lt;/p&gt;

&lt;p&gt;	&quot;indexBounds&quot; : &lt;/p&gt;
{
		&quot;votes.created_at&quot; : [
			[
				ISODate(&quot;2010-10-31T13:37:20Z&quot;),
				ISODate(&quot;292278995-01--2147483647T07:12:56.808Z&quot;)
			]
		]
	}

&lt;p&gt;The upper bound is completely aberrant, and as far as I can tell, nothing in the document justifies such a value. As a consequence, on the real database, this will scan half of the table for every request. On the contrary, 1.8.3 was showing the right upper bound. Please also note that as far as we can tell, our collections have other instances of documents raising the problem (that is, a collection with just this document will exhibit the issue, but just removing the doc from the collection is not enough for the issue to disappear).&lt;/p&gt;
</description>
                <environment>linux ubuntu</environment>
        <key id="24298">SERVER-4180</key>
            <summary>Allow multiple constraints (on same field) within a $elemMatch clause to be used with a multikey index</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="aaron">Aaron Staple</assignee>
                                    <reporter username="kali">Mathieu Poumeyrol</reporter>
                        <labels>
                            <label>regression</label>
                    </labels>
                <created>Mon, 31 Oct 2011 17:09:51 +0000</created>
                <updated>Mon, 11 Jul 2016 18:35:43 +0000</updated>
                            <resolved>Wed, 13 Jun 2012 04:33:22 +0000</resolved>
                                    <version>2.0.1</version>
                                    <fixVersion>2.1.2</fixVersion>
                                    <component>Index Maintenance</component>
                    <component>Querying</component>
                                        <votes>2</votes>
                                    <watches>9</watches>
                                                                                                                <comments>
                            <comment id="132015" author="kali" created="Wed, 13 Jun 2012 19:05:34 +0000"  >&lt;p&gt;This collection is big, and there are actually several ones impacted.&lt;/p&gt;

&lt;p&gt;I asked formally what was going to happen. Once I understood what was happenning, I gave you a testable case, and I POCed a patch. You guys told me there would be a fix for 2.2.&lt;/p&gt;

&lt;p&gt;Now, height months later, I&apos;m stuck with a choice between a &quot;maybe&quot; and a huge and complicated data migration on several collections, including the biggest and most critical of my dataset.&lt;/p&gt;

&lt;p&gt;Please schedule 6050 for 2.2.&lt;/p&gt;

&lt;p&gt;I understand the rush for a 2.2 release... but come on. In the current state, seeing this qualified as &quot;fixed&quot; feels like a very bad joke on me.&lt;/p&gt;</comment>
                            <comment id="131948" author="aaron" created="Wed, 13 Jun 2012 17:42:45 +0000"  >&lt;p&gt;Hi Mathieu - I suggest you change your schema slightly and add an elemMatch to your original query, per the following example.  If &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6050&quot; title=&quot;Consider allowing $elemMatch applied to non arrays&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6050&quot;&gt;&lt;del&gt;SERVER-6050&lt;/del&gt;&lt;/a&gt; is implemented you will not have to change the schema from your original.  Feel free to comment on that issue.&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;c = db.c;&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;c.drop();&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;c.save(&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;           &quot;_id&quot; : &quot;--ITkd13HZw:c9o5i05059t3t-Xw-EIPkVE90&quot;,&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;               &quot;votes&quot; : [&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;                              &quot;browser_id&quot; : &quot;fwAAAU5IAJajhSIyVZiGAg==&quot;,&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;                                  &quot;kind&quot; : &quot;nominate&quot;,&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;                                  &quot;pending&quot; : {&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;                                  &quot;review&quot; : true&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;                                  &quot;created_at&quot; : [ISODate(&quot;2011-10-29T15:49:46.592Z&quot;)],&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;                                      &quot;sql_id&quot; : 3285089,&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;                                      &quot;_id&quot; : 3285089,&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;                                      &quot;user_ip&quot; : &quot;189.82.222.127&quot;,&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;                                      &quot;user&quot; : &quot;c9o5i05059t3t&quot;,&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;                                      &quot;score&quot; : 1&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;                          {&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;                              &quot;browser_id&quot; : &quot;fwAAAU6r166/BhUvNXcCAg==&quot;,&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;                                  &quot;comment&quot; : &quot;&quot;,&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;                                  &quot;kind&quot; : &quot;score&quot;,&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;                                  &quot;created_at&quot; : [ISODate(&quot;2011-10-29T16:31:30.014Z&quot;)],&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;                                  &quot;sql_id&quot; : 3285177,&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;                                  &quot;_id&quot; : 3285177,&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;                                  &quot;relevance&quot; : 1,&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;                                  &quot;origin&quot; : &quot;albums/fotopedia-en-Chaise_longue&quot;,&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;                                  &quot;user_ip&quot; : &quot;93.16.21.63&quot;,&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;                                  &quot;user&quot; : &quot;oGrgsfdBDZM&quot;,&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;                                  &quot;score&quot; : 2,&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;                                  &quot;quality&quot; : 1&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;                          ]&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;       );&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;c.ensureIndex( { &apos;votes.created_at&apos;:1 } );&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;printjson( c.find( { &apos;votes.created_at&apos;:{ $elemMatch:{ &quot;$gte&quot; : ISODate(&quot;2010-10-31T13:37:20Z&quot;), &quot;$lte&quot; : ISODate(&quot;2010-10-31T13:37:35&quot;) } } } ).hint(&quot;votes.created_at_1&quot;).explain() );&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="131849" author="kali" created="Wed, 13 Jun 2012 15:59:34 +0000"  >&lt;p&gt;I&apos;m sorry to be a pain here, but this fix is completely irrelevant to the issue.&lt;/p&gt;

&lt;p&gt;Worse, the implementation of the support for scalar values in $elemMatch being the root cause of the apparition of the regression in the first time, I fear these changes have brought us even farther from an actual resolution.&lt;/p&gt;

&lt;p&gt;I insist: this is a sneaky but major regression (a few other people have mentioned difficulties with the same problem on the irc channel) from 1.8. I sincerely hope we can  have it fixed for 2.2. In any case, we definitely need to reopen it.&lt;/p&gt;</comment>
                            <comment id="131489" author="aaron" created="Wed, 13 Jun 2012 04:32:18 +0000"  >&lt;p&gt;We&apos;ve implemented an optimization allowing the $elemMatch operator to utilize multiple bounds on a multikey index.  So if you do a query { a:{ $elemMatch:&lt;/p&gt;
{ $gte:0, $lte:10 }
&lt;p&gt; } } on index &lt;/p&gt;
{ a:1 }
&lt;p&gt;, only the a-values 0 through 10 will be scanned.&lt;/p&gt;

&lt;p&gt;This optimization doesn&apos;t apply to nested $elemMatch queries, for example { a:{ $elemMatch:{ b:&lt;/p&gt;
{ $gte:0, $lte:10 }
&lt;p&gt; } } on index &lt;/p&gt;
{ &apos;a.b&apos;:1 }
&lt;p&gt;.  Since the $elemMatch operator is applied to a and not &apos;a.b&apos;, only one bound constraint can be applied to the values of &apos;a.b&apos;, and in this case all &apos;a.b&apos; values &amp;gt;= 0 would be scanned.&lt;/p&gt;

&lt;p&gt;In the above situation you might consider a query like { &apos;a.b&apos;:{ $elemMatch:&lt;/p&gt;
{ $gte:0, $lte:10 }
&lt;p&gt; } } instead.  Keep in mind though that (pending &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6050&quot; title=&quot;Consider allowing $elemMatch applied to non arrays&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6050&quot;&gt;&lt;del&gt;SERVER-6050&lt;/del&gt;&lt;/a&gt;) $elemMatch can only be applied to arrays.  So the query { &apos;a.b&apos;:{ $elemMatch:&lt;/p&gt;
{ $gte:0, $lte:10 }
&lt;p&gt; } } would match the documents { _id:0, a:&lt;/p&gt;
{ b:[ 5 ] }
&lt;p&gt; } and { _id:1, a:[ &lt;/p&gt;
{ b:[ 5 ] }
&lt;p&gt; ] } but not { _id:2, a:[ &lt;/p&gt;
{ b:5 }
&lt;p&gt; ] }.&lt;/p&gt;</comment>
                            <comment id="129403" author="auto" created="Sat, 9 Jun 2012 17:28:18 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;astaple&apos;, u&apos;name&apos;: u&apos;Aaron&apos;, u&apos;email&apos;: u&apos;aaron@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4180&quot; title=&quot;Allow multiple constraints (on same field) within a $elemMatch clause to be used with a multikey index&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4180&quot;&gt;&lt;del&gt;SERVER-4180&lt;/del&gt;&lt;/a&gt; Document FieldRange and FieldRangeSet constructors.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/af775374ea8b2184cd4c311468c2f86338876d9c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/af775374ea8b2184cd4c311468c2f86338876d9c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="129401" author="auto" created="Sat, 9 Jun 2012 17:28:16 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;astaple&apos;, u&apos;name&apos;: u&apos;Aaron&apos;, u&apos;email&apos;: u&apos;aaron@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4180&quot; title=&quot;Allow multiple constraints (on same field) within a $elemMatch clause to be used with a multikey index&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4180&quot;&gt;&lt;del&gt;SERVER-4180&lt;/del&gt;&lt;/a&gt; Generate single key index bounds for $elemMatch expressions of the &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1264&quot; title=&quot;$elemMatch on subArray&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1264&quot;&gt;&lt;del&gt;SERVER-1264&lt;/del&gt;&lt;/a&gt; style (where matching is applied to the $elemMatch field itself, not subfields).&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/bb0fd337ac9498a5642986bba162880fa3030ce0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/bb0fd337ac9498a5642986bba162880fa3030ce0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="129400" author="auto" created="Sat, 9 Jun 2012 17:28:14 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;astaple&apos;, u&apos;name&apos;: u&apos;Aaron&apos;, u&apos;email&apos;: u&apos;aaron@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4180&quot; title=&quot;Allow multiple constraints (on same field) within a $elemMatch clause to be used with a multikey index&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4180&quot;&gt;&lt;del&gt;SERVER-4180&lt;/del&gt;&lt;/a&gt; Remove optional arguments to FieldRange and FieldRangeSet constructors.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/ab0bfed139f35ab5a3e1de7241ebfb5922faf2ee&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/ab0bfed139f35ab5a3e1de7241ebfb5922faf2ee&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="129396" author="auto" created="Sat, 9 Jun 2012 17:28:09 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;astaple&apos;, u&apos;name&apos;: u&apos;Aaron&apos;, u&apos;email&apos;: u&apos;aaron@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4180&quot; title=&quot;Allow multiple constraints (on same field) within a $elemMatch clause to be used with a multikey index&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4180&quot;&gt;&lt;del&gt;SERVER-4180&lt;/del&gt;&lt;/a&gt; Fixes and cleanups for $elemMatch index range calculation, in particular to clean up incorrect bound generation for &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1264&quot; title=&quot;$elemMatch on subArray&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1264&quot;&gt;&lt;del&gt;SERVER-1264&lt;/del&gt;&lt;/a&gt; style $elemMatch queries.  Includes fixes for &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-5740&quot; title=&quot;index bounds may be incorrectly determined for $not:$elemMatch queries&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-5740&quot;&gt;&lt;del&gt;SERVER-5740&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-5741&quot; title=&quot;nested $elemMatch queries are not handled in queryutil, trigger &amp;quot;warning: shouldn&amp;#39;t get here?&amp;quot; log message&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-5741&quot;&gt;&lt;del&gt;SERVER-5741&lt;/del&gt;&lt;/a&gt;.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/2b572b9c07d8d3feda949153e20b9eee8706ff7d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/2b572b9c07d8d3feda949153e20b9eee8706ff7d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="129394" author="auto" created="Sat, 9 Jun 2012 17:28:06 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;astaple&apos;, u&apos;name&apos;: u&apos;Aaron&apos;, u&apos;email&apos;: u&apos;aaron@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4180&quot; title=&quot;Allow multiple constraints (on same field) within a $elemMatch clause to be used with a multikey index&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4180&quot;&gt;&lt;del&gt;SERVER-4180&lt;/del&gt;&lt;/a&gt; Fixes and cleanups for $elemMatch matching, including fix for &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6001&quot; title=&quot;key matching is not handled properly for the $elemMatch operator&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6001&quot;&gt;&lt;del&gt;SERVER-6001&lt;/del&gt;&lt;/a&gt;.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/68775795d16f6a3854341f16d4cab32d1bc76830&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/68775795d16f6a3854341f16d4cab32d1bc76830&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="104278" author="eliot" created="Wed, 28 Mar 2012 13:26:01 +0000"  >&lt;p&gt;This is scheduled for 2.1.2, so we&apos;ll be working on it a couple of weeks.&lt;/p&gt;</comment>
                            <comment id="66151" author="kali" created="Fri, 11 Nov 2011 07:24:39 +0000"  >&lt;p&gt;Anybody listening here ?&lt;/p&gt;</comment>
                            <comment id="64586" author="kali" created="Thu, 3 Nov 2011 21:52:37 +0000"  >&lt;p&gt;In the end, I went for strategy #3. The results are &lt;a href=&quot;https://github.com/kali/mongo/commit/a559b7132ae5d595e0d63bb7a89231ab9bacb2d8&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/kali/mongo/commit/a559b7132ae5d595e0d63bb7a89231ab9bacb2d8&lt;/a&gt; . It is a bigger patch than I expected, and it will be a pain to rebase to other versions, but if I&apos;m pretty sure I&apos;ll get it to work on 2.0 and get us out of trouble for now.&lt;/p&gt;

&lt;p&gt;Eliot, guys, I would like to know if something of the sort has a remote chance to be integrated. I would assume not before 2.1 anyway, but in that case I would spend a few more hours tidying every loose end I can see or sensible changes you want made. I do think there is value in making the hint system extensible, but the way I chose may not be of your liking.&lt;/p&gt;

&lt;p&gt;If you don&apos;t like the idea at all, please let me know what are the plans (or even lack of plan) to get a fix (or a won&apos;t fix) for the range vs multivalued optimization issue. A rough idea of the version it may land would be of great help. Apologies for being a pain, but there is a huge performance regression here, and for us at least, a definite show-stopper for features that have taken already months to implement based on assumptions made on 1.8 behavior.&lt;/p&gt;</comment>
                            <comment id="64322" author="kali" created="Wed, 2 Nov 2011 20:39:42 +0000"  >&lt;p&gt;giving a shot at a patch for strategy #2.&lt;/p&gt;</comment>
                            <comment id="64159" author="kali" created="Wed, 2 Nov 2011 10:34:04 +0000"  >&lt;p&gt;My understanding of the issue is the optimizer refuses to consider the query a range query because it can not know that the inner key, &quot;a&quot;, in the previous example, is never multivalued. So I was looking for ways to convey this information to the optimizer:&lt;br/&gt;
1/ extend the &quot;multiKey&quot; index property semantics: store the indexes of multivalued tokens in the path instead of just the boolean. That would be the most elegant, as no user intervention would be required to hint the optimizer. But the way the multiKey is stored (as a single bit in a namespace-wide bitmap) make it a very heavy change. The IndexDetails might be another place, but as far as I can tell the &quot;info&quot; doc is read-only.&lt;br/&gt;
2/ a variant: manual hint the index at index creation and store the hint in the IndexDetails.info doc (something in the form &apos;multiValued : &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;v&amp;quot;&amp;#93;&lt;/span&gt;&apos;).&lt;br/&gt;
3/ provide the same information to the optimizer extending the index &quot;hint&quot;&lt;br/&gt;
4/ make the fact we mean &quot;range&quot; explicit in the query syntax: &apos;{ &quot;v&quot; : { $elemMatch : { &quot;a&quot; : { $range : &lt;/p&gt;
{ $gte : 3, $lte : 5 }
&lt;p&gt;}}}}&apos;&lt;/p&gt;</comment>
                            <comment id="63916" author="kali" created="Tue, 1 Nov 2011 08:22:41 +0000"  >&lt;p&gt;So, with the JS display of the maximum date value set aside, a much simpler testcase is:&lt;/p&gt;

&lt;p&gt;db.test.drop()&lt;br/&gt;
db.test.save({ v: [ &lt;/p&gt;
{ a: 1}
&lt;p&gt;, &lt;/p&gt;
{ a: 4}
&lt;p&gt;, &lt;/p&gt;
{ a:8}
&lt;p&gt; ] })&lt;br/&gt;
db.test.ensureIndex(&lt;/p&gt;
{&quot;v.a&quot; : 1}
&lt;p&gt;)&lt;br/&gt;
plan = db.test.find({ &quot;v&quot; : { $elemMatch : { &quot;a&quot; : { &quot;$gte&quot; : 3, &quot;$lte&quot; : 5}}}}).explain()&lt;br/&gt;
assert.eq(5, plan.indexBounds&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;v.a&amp;quot;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;)&lt;/p&gt;

&lt;p&gt;It was passing in 1.8.2 (haven&apos;t test 1.8.3) and is breaking in 2.0.1.&lt;/p&gt;</comment>
                            <comment id="63817" author="kali" created="Mon, 31 Oct 2011 20:38:54 +0000"  >&lt;p&gt;OK, I understand the possible semantic ambiguity with multivalued field. But are you sure 2.0 choice is better than the 1.8 ?&lt;/p&gt;

&lt;p&gt;As a matter of fact, what my query means is &quot;some actual value in the range&quot; not &quot;any absurd combination of unrelated values managing to somehow match the range as a side effect&quot;...&lt;/p&gt;

&lt;p&gt;The actual query I started investigating with was using $elemMatch (as a third filtering criteria was applied to the a potential matching &quot;vote&quot;). In that case, the ambiguity of the query $lt/$gt over a subdocument was gone.&lt;/p&gt;

&lt;p&gt;If I understand correctly, the 1.8 behavior is not reproducible with 2.0. That is a big regression as far as we are concerned. Optimization of these queries are a critical issue for us, meaning we will be stuck with 1.8 as long as these range semantics are not somehow restored. Our application can&apos;t afford the supplementary data scan the new semantics implies.&lt;/p&gt;</comment>
                            <comment id="63798" author="aaron" created="Mon, 31 Oct 2011 20:02:11 +0000"  >&lt;p&gt;Because your field is multikey we can only use one index bound for the index on this field, not both an upper and lower bound.&lt;/p&gt;

&lt;p&gt;Please see &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4155&quot; title=&quot;Index bound incorrect?&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4155&quot;&gt;&lt;del&gt;SERVER-4155&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="17142">SERVER-3104</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="40440">SERVER-6002</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="46322">SERVER-6720</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="61554">SERVER-8135</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="24312">SERVER-4184</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="13669" name="testcase.date_broken_range.tgz" size="785" author="kali" created="Mon, 31 Oct 2011 17:09:51 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>17.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 31 Oct 2011 20:02:11 +0000</customfieldvalue>

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


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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            11 years, 36 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>aaron</customfieldvalue>
            <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>kali</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hromtb:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>8107</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_10166" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Tests Written</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10154"><![CDATA[Complete]]></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|hrkmjz:</customfieldvalue>

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