簡單的問題:如何將數據從SQL Server導出到RavenDB?RavenDB export 導入數據到SQL Server
我寫了一個腳本,它從SQL Server獲取數據並存儲在烏鴉中,但其工作非常緩慢。每秒大約2500個插入。
編輯: 我的代碼
for (int i = 0; i < count; i+=8196)
{
StoreInTaven(WordStats.Skip(i).Take(8196).Select(x => new KeyPhraseInfo(){
Key = x.Word,
Id = x.Id,
Count = x.Count,
Date = x.Date
}));
GC.Collect();
}
public static void StoreInTaven(IEnumerable<KeyPhraseInfo> wordStats)
{
using(var session = store.OpenSession())
{
foreach (var wordStat in wordStats)
{
session.Store(wordStat);
}
session.SaveChanges();
}
}
後的代碼你使用插入到RavenDB。插入的速度是你的代碼的一個因素,也可能是它運行的機器。 – 2012-05-29 05:13:00