<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:31:43 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-13434] Record does not seem to be indexed correctly</title>
                <link>https://jira.mongodb.org/browse/SERVER-13434</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I have a record in my database but it doesn&apos;t seem to be indexed correctly.&lt;br/&gt;
I have a compound index&lt;br/&gt;
        {&lt;br/&gt;
                &quot;v&quot; : 1,&lt;br/&gt;
                &quot;key&quot; : &lt;/p&gt;
{
                        &quot;device&quot; : 1,
                        &quot;time&quot; : -1
                }
&lt;p&gt;,&lt;br/&gt;
                &quot;ns&quot; : &quot;loco.history&quot;,&lt;br/&gt;
                &quot;name&quot; : &quot;device_1_time_-1&quot;&lt;br/&gt;
        },&lt;/p&gt;

&lt;p&gt;and this is used to run the query.&lt;/p&gt;

&lt;p&gt;locobase:SECONDARY&amp;gt; db.history.find({device:357207050859404,&quot;time&quot;:{&quot;$gt&quot;:start,&quot;$lt&quot;:end}}).explain()&lt;br/&gt;
{&lt;br/&gt;
        &quot;cursor&quot; : &quot;BtreeCursor device_1_time_-1&quot;,&lt;br/&gt;
        &quot;isMultiKey&quot; : false,&lt;br/&gt;
        &quot;n&quot; : 19,&lt;br/&gt;
        &quot;nscannedObjects&quot; : 19,&lt;br/&gt;
        &quot;nscanned&quot; : 19,&lt;br/&gt;
        &quot;nscannedObjectsAllPlans&quot; : 19,&lt;br/&gt;
        &quot;nscannedAllPlans&quot; : 19,&lt;br/&gt;
        &quot;scanAndOrder&quot; : false,&lt;br/&gt;
        &quot;indexOnly&quot; : false,&lt;br/&gt;
        &quot;nYields&quot; : 0,&lt;br/&gt;
        &quot;nChunkSkips&quot; : 0,&lt;br/&gt;
        &quot;millis&quot; : 0,&lt;br/&gt;
        &quot;indexBounds&quot; : &lt;/p&gt;
{
                &quot;device&quot; : [
                        [
                                357207050859404,
                                357207050859404
                        ]
                ],
                &quot;time&quot; : [
                        [
                                ISODate(&quot;2015-04-01T00:00:00Z&quot;),
                                ISODate(&quot;2010-04-01T00:00:00Z&quot;)
                        ]
                ]
        }
&lt;p&gt;,&lt;br/&gt;
        &quot;server&quot; : &quot;uk4.loco-pos.net:27017&quot;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;note: there are 19 items found&lt;/p&gt;

&lt;p&gt;but if I give a hint to not use the time field in the index I get&lt;/p&gt;

&lt;p&gt;locobase:SECONDARY&amp;gt; db.history.find({device:357207050859404,&quot;time&quot;:{&quot;$gt&quot;:start,&quot;$lt&quot;:end}}).hint(&lt;/p&gt;
{device:1}
&lt;p&gt;).explain()&lt;br/&gt;
{&lt;br/&gt;
        &quot;cursor&quot; : &quot;BtreeCursor device_1&quot;,&lt;br/&gt;
        &quot;isMultiKey&quot; : false,&lt;br/&gt;
        &quot;n&quot; : 19,&lt;br/&gt;
        &quot;nscannedObjects&quot; : 20,&lt;br/&gt;
        &quot;nscanned&quot; : 20,&lt;br/&gt;
        &quot;nscannedObjectsAllPlans&quot; : 20,&lt;br/&gt;
        &quot;nscannedAllPlans&quot; : 20,&lt;br/&gt;
        &quot;scanAndOrder&quot; : false,&lt;br/&gt;
        &quot;indexOnly&quot; : false,&lt;br/&gt;
        &quot;nYields&quot; : 0,&lt;br/&gt;
        &quot;nChunkSkips&quot; : 0,&lt;br/&gt;
        &quot;millis&quot; : 0,&lt;br/&gt;
        &quot;indexBounds&quot; : &lt;/p&gt;
{
                &quot;device&quot; : [
                        [
                                357207050859404,
                                357207050859404
                        ]
                ]
        }
&lt;p&gt;,&lt;br/&gt;
        &quot;server&quot; : &quot;uk4.loco-pos.net:27017&quot;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;now there are 20 items.&lt;/p&gt;

&lt;p&gt;The missing item has &lt;br/&gt;
locobase:SECONDARY&amp;gt; db.history.findOne({_id:ObjectId(&quot;533a8bf3d6e909b3c29e6e38&quot;)}).time&lt;br/&gt;
ISODate(&quot;2014-04-01T09:50:43.487Z&quot;)&lt;/p&gt;

&lt;p&gt;as far as I know, There are no other records with this problem and everything else seems normal.&lt;br/&gt;
I realise 2.2.2 is quite old but this may still be relevant.&lt;/p&gt;</description>
                <environment></environment>
        <key id="128736">SERVER-13434</key>
            <summary>Record does not seem to be indexed correctly</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="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="-1">Unassigned</assignee>
                                    <reporter username="ianmartin">Ian Martin</reporter>
                        <labels>
                    </labels>
                <created>Tue, 1 Apr 2014 13:09:22 +0000</created>
                <updated>Wed, 10 Dec 2014 23:11:56 +0000</updated>
                            <resolved>Tue, 1 Apr 2014 15:17:27 +0000</resolved>
                                    <version>2.2.2</version>
                                                    <component>Shell</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="530940" author="ianmartin" created="Tue, 1 Apr 2014 15:09:48 +0000"  >&lt;p&gt;Oh Yes,&lt;br/&gt;
I think I probably just saw what I was expecting to see there because.&lt;/p&gt;

&lt;p&gt;locobase:SECONDARY&amp;gt; db.history.find({device:357207050859404,&quot;time&quot;:{&quot;$gt&quot;:start,&quot;$lt&quot;:end}}).count()&lt;br/&gt;
20&lt;br/&gt;
locobase:SECONDARY&amp;gt; db.history.find(&lt;/p&gt;
{device:357207050859404}
&lt;p&gt;).count()&lt;br/&gt;
21&lt;/p&gt;

&lt;p&gt;however, I have a record without a time field which would explain that.&lt;/p&gt;

&lt;p&gt;I am still seeing fewer records from my java program though but that problem must be elsewhere.&lt;br/&gt;
I&apos;ll make sure I have my java driver up to date and test it again.&lt;/p&gt;

&lt;p&gt;Sorry for the misleading report.&lt;/p&gt;
</comment>
                            <comment id="530910" author="schwerin" created="Tue, 1 Apr 2014 14:52:12 +0000"  >&lt;p&gt;Both plans return 19 results (n: 19).  The first plan uses the more selective index to only examine the 19 matching documents, while the second plan uses the less selective index to visit the 20 documents matching the device component of the query, and then filters out the one of those 20 documents that does not match the time bounds.  Can you confirm the values of the &quot;start&quot; and &quot;end&quot; times you&apos;re using?&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>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 1 Apr 2014 14:52:12 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        9 years, 46 weeks, 1 day 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>
                            9 years, 46 weeks, 1 day 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_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>schwerin@mongodb.com</customfieldvalue>
            <customfieldvalue>ianmartin</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrlxnr:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>110243</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_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|hsh0pb:</customfieldvalue>

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