[SERVER-3611] CLONE - query that just returns value in index should get data from index Created: 16/Aug/11  Updated: 16/Aug/11  Resolved: 16/Aug/11

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

Type: Improvement Priority: Major - P3
Reporter: Tino Ehrich Assignee: Eliot Horowitz (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-2109 Query optimizer should pick plans tha... Closed
Participants:

 Description   

if you have something like
db.users.save(

{ name : "" , address... , etc... }

)
db.users.ensureIndex(

{ name : 1 }

)
and you do
db.users.find( {} ,

{ name : 1 }

)
it should only look at the index and never go to object.



 Comments   
Comment by Eliot Horowitz (Inactive) [ 16/Aug/11 ]

See: SERVER-2109

Comment by Tino Ehrich [ 16/Aug/11 ]

This issue still exists for 1.8.2

When adding an index

db.contacts.ensureIndex(

{name:1}

)

and querying via

db.contacts.find({},

{name:1,_id:0}

)

no index is touched. Index is only touched when forced via

hint(

{name:1}

) or via sort(

{name:1}

)

PS: I am new here so I hope that cloning the old issue is the correct workflow. Cheers

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