forked from comtihon/mongodb-erlang
-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Hi TonyGen
in mongodb table I have 50k data
in this 50k I have 20k data with some username(ravi1)
Cur = mongo:find (emaillist, {'$query', {'userName', UserName}, '$orderby', {'userName',1}}, {},0, 5),
when I do such find query, here I get 5 records but it takes same time finding all 20k records
but if
Cur = mongo:find (emaillist, {'$query', {'userName', UserName}, '$orderby', {'userName',1}}, {},19,995, 5)
this also gives me 5 records but in no time
why first query takes more time to find 5 records
is there any other way so that I can get record faster in any case
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels