Skip to Main Content
HCL Domino Ideas Portal

Welcome to the #dominoforever Product Ideas Forum! The place where you can submit product ideas and enhancement request. We encourage you to participate by voting on, commenting on, and creating new ideas. All new ideas will be evaluated by HCL Product Management & Engineering teams, and the next steps will be communicated. While not all submitted ideas will be executed upon, community feedback will play a key role in influencing which ideas are and when they will be implemented.

For more information and upcoming events around #dominoforever, please visit our Destination Domino Page

Status Needs Review
Workspace Domino Designer
Categories LotusScript
Created by Guest
Created on Dec 17, 2024

Improve performance when iterating documents in views

Iterating documents based on a view object has become very slow in later years. Maybe because of all the work that has been with NIF-index issues.


The following techniques show poor (some even very poor) performance when running in the client against a server database:

Set view = dbSource.Getview("vCategoryOneCategory")

Set vec = view.Getallentriesbykey("Documents",True)

Set ve = vec.Getfirstentry()

While Not ve Is Nothing

Let lCount = lCount + 1

Set ve = vec.Getnextentry(ve)

Wend


Set doc = view.Getfirstdocument()

While Not doc Is Nothing

Let lCount = lCount + 1

Set doc = view.Getnextdocument(doc)

Wend


Set nav = view.Createviewnav()

Set ve = nav.Getfirst()

While Not ve Is Nothing

Let lCount = lCount + 1

Set ve = nav.Getnext(ve)

Wend


Whereas the following show good (even very good) performance:

Set view = dbSource.Getview("vCategoryOneCategory")

Let view.Autoupdate = False

Set nav = view.Createviewnavfromcategory("Documents")

Let nav.Buffermaxentries = BUFFER_MAX_ENTRIES

Set ve = nav.Getfirst()

While Not ve Is Nothing Let lCount = lCount + 1

Set ve = nav.Getnext(ve)

Wend

Let view.Autoupdate = True


Set view = dbSource.Getview("vCategoryOneCategory")

Set dc = view.Getalldocumentsbykey("Documents",True)

Set doc = dc.Getfirstdocument()

While Not doc Is Nothing

Let lCount = lCount + 1

Set doc = dc.Getnextdocument(doc)

Wend

In very large databases the search takes longer, the looping is always fast.
Set
dc = dbSource.Search(strFormula,Nothing,0)
Set doc = dc.Getfirstdocument()
Do Until doc Is Nothing
Let
lCount = lCount + 1
Set doc = dc.Getnextdocument(doc)
Loop

  • Attach files