我有一个大约80,000个条目的记录集。我不确定我做对了吗,但是搜索大约需要 4.4秒-似乎很慢?
我的数据模型类(提取):
Public Class mOrganisation
<Id(1, 1), Category("Operational"), DisplayName("ID"), [ReadOnly](True)>
Public Property ID As ObjectId = ObjectId.NewObjectId
<Id(1, 2), Category("General"), DisplayName("Name"), Description("Commonly used Name")>
Public Property Name As String
我的收集助手(在应用初始化期间调用):
Public Class dbCollection
mOrganisations = _dbConnection.GetCollection(Of mOrganisation)("mOrganisations")
mOrganisations.EnsureIndex(Function(x) x.Name)
我的搜索(db.collections引用dbcollections):
Dim dev As New mOrganisation
dev = db.Collections.mOrganisations.Find(Function(x) x.Name = "Atari").FirstOrDefault
我可以加快速度吗?我会为所有提示锦上添花...