Hi there,
I'm attempting to use db4o as the back-end for my new website.
I've set things up, as I thought sensible, and have inserted about 5k records (of only one object type, with about 7 primitive fields).
As per some blog posts I've read, I've setup the properties as non-automatic properties, and tried to set indexes on the private members exposed by the public properties.
Query performance is really bad, with what should be a simple indexed lookup taking upto 3/4 seconds.
My implementation is a follows: My 'Server' is a static singleton, only opened once per application instance.
Db4oFactory.Configure().ObjectClass(typeof(MyObject)).ObjectField("_Id").Indexed(true);
server = Db4oClientServer.OpenServer("DatabseName", 0);
then, to query:
using (var ooDB = server.OpenClient())
{
var movieFound = (from MyObject m in ooDB
where m.Id == IdToFind
select m).FirstOrDefault();
}
With my object as:
public class MyObject
{
protected string _Id;
public string Id
{
get { return _Id; }
set { _Id = value; }
}
}
The Object's Id is a string.
What am I doing wrong!
Cheers, Dave