Hi All –
I have a very large database that has almost 500,000 documents and is over 8 gig. This database is continually getting documents sent into it. We have several agents that process these documents in different ways depending on the type of document. These agents run on schedule throughout the day.
I wanted to make sure that I had the best method for handling these documents. We have usually used the standard walk the view method, but we also have a few agents that uses notesviewentrycollection class. We did have a problem with this agent when we had over 30,000 documents to process, but the agent is very complex. I’m not sure if the walk the view method would be faster. For each document, we are reading and editing fields.
I have checked the Performance Considerations redbook (http://www.redbooks.ibm.com/pubs/pdfs/redbooks/sg245602.pdf) and I could not find any specific references that said which way was faster. I did see a reference in a whitepaper by Team Studio that they thought the faster method when processing was probably the walk the view method (“If you wish to get a handle to a document, grab some data or do some processing to the document and then move on to the next document in a view. Then, it is probably most efficient to use db.GetView and iterate through all the documents in the view.” - http://www.teamstudio.com/OptimizingLotusScriptWhitePaper.pdf). Has anyone seen any benefit of using one class over the other? What about the NotesViewNavigator class?
Below is a sample script for notesviewentrycollection:
Dim view As NotesView
Dim vc As NotesViewEntryCollection
Dim e As NotesViewEntry
Dim ne As NotesViewEntry
Dim doc As NotesDocument
Set view = db.GetView(“(Process)”)
Set vc = view.AllEntries
Set e = vc.GetFirstEntry()
Do Until e Is Nothing
Set ne = vc.GetNextEntry(e)
Set doc = e.Document
Set e = ne
Loop
Below is sample notesview script:
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set view = db.GetView("(Process)")
view.AutoUpdate=False
Set doc = view.GetFirstDocument
While Not doc Is Nothing
<processing>
Set doc = view.GetNextDocument(doc)
Wend
Donna