What index to use for mongodb? -



What index to use for mongodb? -

i have documents this:

{ { "_id": objectid("5444fc67931f8b040eeca671"), "meta": { "sessionid": "45", "configversion": "1", "deviceid": "55", "parentobjectid": "55", "nodeclass": "79", "dnproperty": "16" }, "cfg": { "name": "test" } }

the names , info testing atm. have total of 25million documents in db. , i'm using find() fetch specific document(s) in find() utilize 4 arguments in case, dnproperty, nodeclass, deviceid , configversion none of them unique.

atm. have index setup simple as:

ensureindex([["nodeclass", 1],["deviceid", 1],["configversion", 1], ["dnproperty",1]])

in other words have index on 4 arguments. still have huge problems if search doesn't find document @ all. in illustration "data" random 1-100 if find() 1 of values > 100 takes anywhere 30-180sec perform search uses of 8gb ram, since there no ram left computer goes very slow.

what improve indexes? using indexes correct? need more ram since set "all" of db in it's working memory? recommend db (other mongo) handle better?

sorry multiple questions hope short plenty can give me answer.

mongodb uses memory mapped files means re-create of info , indexes stored in ram , whenever there query fetches ram itself. in current scenario queries slower because info + indexes size big not fit in ram , hence there lot of i/o activity info disk bottleneck.

sharding helps in solving problem because if partition/shard info across illustration 5 machines have 8gb * 5 = 40gb ram can hold (dataset + indexes = working set) in ram , overhead of i/o reduced leading improved performance.

hence in case indexes not help improve performance beyond point, need shard info across multiple machines. sharding tend increment read write throughput linearly. sharding in mongodb

mongodb

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

java - Parsing XML, skip certain tags -

c# - ASP.NET MVC Sequence contains no matching element -