c# - MongoDb Query doesn't return all of the time -
i have simple query running against mongo using official c# driver 1.8 returns performing query 50% of time. have unit test , if run query return 50% of time in less second other times never finish.
below query
var q = database.getcollection<stuff>("stuff").asqueryable() .where(x => x.partition == partitionname && x.persistantid != null && ( (x.when.datestart > startingfrom && x.when.dateend == null) || (x.when.dateend > startingfrom))); return q.tolist();
when take query , run in mongovue using query below can response in under 1 second.
{ "partition" : "partitionid:53", "persistantid" : { "$ne" : null }, "$or" : [{ "when.datestart" : { "$gt" : isodate("2012-04-01t06:00:00z") }, "when.dateend" : null }, { "when.dateend" : { "$gt" : isodate("2012-04-01t06:00:00z") } }] }
it seems perhaps bug in 1.8 driver or mongodb 2.4.1. collection has 70,000 items , on mongo server running on windows 4 gigs of memory , couple processors.
are there diagnostic logs can @ or perhaps errors query?
use mongodb inbuild profiler , think what's going wrong in query sometime http://docs.mongodb.org/manual/tutorial/manage-the-database-profiler/
Comments
Post a Comment