Mongoデータベースからドキュメントを取得し、内部ストレージにコピーしています。私は、これらのドキュメントを100個取り出して保存するのに数秒以上かかることがわかっています。パフォーマンスを改善するためにできることはありますか?いくつかのコレクションには1000を超えるドキュメントがあります。ここで私はMongoドキュメントの検索パフォーマンスを改善する方法
' get the documents from collection "reqitems" and put them in "collection"
Dim collection As IFindFluent(Of BsonDocument, BsonDocument) = _
reqitems.Find(Builders(Of BsonDocument).Filter.Empty)
ReDim model.ReqItems(TotalCollection.ToList.Count) ' storage for the processed documents
For Each item As BsonDocument In TotalCollection.ToList()
' note: given a string a=x, "GetRHS" returns x
Dim parentuid As String = GetRHS(item.GetElement("parentuid").ToString)
Dim nodename As String = GetRHS(item.GetElement("nodename").ToString)
' .... about a dozen of these elements
' .... process the elements and copy them to locations in model.ReqItems
next