I made an application where I would query a database with RavenDB. I use it only on my local machine so I want to change from Raven.Server to Embedded client. But I noticed my query time I so high when using embedded client.
private static EmbeddableDocumentStore documentStore { get; set; }
public static void Connect()
{
documentStore = new EmbeddableDocumentStore() {/* Url = "http://" + Properties.Settings.Default.DatabaseHost + ":" + Properties.Settings.Default.DatabasePort */ DataDirectory = "Data"};
documentStore.Initialize();
IndexCreation.CreateIndexes(typeof(eBayItemIndexer).Assembly, documentStore);
IndexCreation.CreateIndexes(typeof(RemoveIndexer).Assembly, documentStore);
}
This is for connection the to the DB. And here is how I exectute my query:
session.Advanced.DocumentStore.DatabaseCommands.Query("eBayItemIndexer", new Raven.Abstractions.Data.IndexQuery() { Query = RawQuery }, new string[] { "Id" });
Now if I use the EmbeddedDocumentStore my query time is: ~300 ms. If I use DocumentStore and connect to the local server my query time is: 4 - 10 ms.
I would think embedded client is faster? Am I doing something wrong because a query time of 300ms is way to high.