[SERVER-5607] cursor iteration constants should be better Created: 14/Apr/12  Updated: 06/Dec/22  Resolved: 04/Dec/15

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Eliot Horowitz (Inactive) Assignee: Backlog - Query Team (Inactive)
Resolution: Done Votes: 0
Labels: query_triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query
Operating System: ALL
Participants:

 Description   

N = 10000;
if ( db.foo.count() != N ) {
    db.foo.drop();
    for ( i=0; i<N; i++ ) 
        db.foo.insert( { x: i } );
    db.getLastError();
}
 
db.foo.dropIndex( { x : 1 } );
printjson( db.foo.find( { x : { $gt : 0 } } ).explain() );
 
db.foo.ensureIndex( { x : 1 } )
printjson( db.foo.find( { x : { $gt : 0 } } ).explain() );
 
db.foo.ensureIndex( { x : 1 } )
printjson( db.foo.find( { x : { $gt : 0 } } , { x : 1 , _id : 0 } ).explain() );



 Comments   
Comment by J Rassi [ 04/Dec/15 ]

I can confirm that version 2.1.0 of the server shows "nscannedObjects: 9999" for the find with the projection above. This is unexpected, as the query is coverable. Version 2.4.0 (and version 3.0.7, the latest stable) correctly show no objects scanned for this operation.

Closing as "Gone Away".

Generated at Thu Feb 08 03:09:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.