title: db4o Indexing problem - Not Working? Poor performance?
body: <p>I'm attempting to use db4o as the back-end for my new website.</p>
  
  <p>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).</p>
  
  <p>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.</p>
  
  <p>Query performance is really bad, with what should be a simple indexed lookup taking upto 3/4 seconds.</p>
  
  <p>My implementation is a follows:
  My 'Server' is a static singleton, only opened once per application instance.</p>
  
  <pre><code>Db4oFactory.Configure().ObjectClass(typeof(MyObject)).ObjectField("_Id").Indexed(true);
  server = Db4oClientServer.OpenServer("DatabseName", 0);
  </code></pre>
  
  <p>then, to query:</p>
  
  <pre><code>using (var ooDB = server.OpenClient())
  {
      var movieFound = (from MyObject m in ooDB
                      where m.Id == IdToFind
                      select m).FirstOrDefault();
  }
  </code></pre>
  
  <p>With my object as:</p>
  
  <pre><code>public class MyObject
  {
      protected string _Id;
      public string Id 
      { 
          get { return _Id; } 
          set { _Id = value; } 
      }
  }
  </code></pre>
  
  <p>The Object's Id is a string.</p>
  
  <p>What am I doing wrong!</p>
  
  <p>Cheers,
  Dave</p>