RavenDB を使用してデータベースにクエリを実行するアプリケーションを作成しました。ローカル マシンでのみ使用するため、Raven.Server から Embedded クライアントに変更したいと考えています。しかし、組み込みクライアントを使用すると、クエリ時間が非常に長くなることに気付きました。
private static EmbeddableDocumentStore documentStore { get; 設定; }
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);
}
これはDBに接続するためのものです。そして、ここに私のクエリを実行する方法があります:
session.Advanced.DocumentStore.DatabaseCommands.Query("eBayItemIndexer", new Raven.Abstractions.Data.IndexQuery() { Query = RawQuery }, new string[] { "Id" });
EmbeddedDocumentStore を使用すると、クエリ時間は ~300 ミリ秒になります。DocumentStore を使用してローカル サーバーに接続した場合、クエリ時間は 4 ~ 10 ミリ秒です。
組み込みクライアントの方が速いと思いますか? 300 ミリ秒のクエリ時間が長すぎるため、私は何か間違ったことをしていますか?