5 pts.
 Can I rebuild a view index using a LotusScript agent?
I have a datebase containing around 250,000 documents up to 12 months old. The last 30 days documents are updated by and hourly agent by deleting and recreating them (using data imported from sql query) as this seems to be faster than searching for and updating each document. Another agent runs nightly and performs the same operation on the other 11 months of documents. The problem I am having is the hourly agent takes around 15 mins to run and access to the documents during this time is almost impossible (this database needs to be VERY responsive), but after the agent has run access is still slow (via web access) unless I physically go into the view in the database which I believe reindexes it. What I want to know is if I can do the reindex using the agent after it has manipulated the files?

Software/Hardware used:
ASKED: September 16, 2008  9:39 AM
UPDATED: September 16, 2008  4:19 PM

Answer Wiki:
What I do with a similarly sized database is run a program document to update the view indexes. This program document is scheduled to run after the agent runs and manipulates the records. Program documents are created and managed in the Directory Configuration > Servers > Programs. Program name: Updall Command line: folderdatabase.nsf -V Server to run on: Servername/Domain Schedule this to run at a time when you know the record updates will be complete. I think it is also possible to issue an updall command from within LotusScript, but I have never tried it. ================ additional answer: I think it's a waste of resources writing a LotusScript agent to do what updall already does. Please remember that LotusScript agents have to Compile at runtime... use Updall. Also, I find it hard to believe deleting and creating is more efficient or even faster. I'd recheck your code, maybe it can be improved? And also, if you are constantly deleting from a database, you will need to Compact it more often than normal, and risk corruption easier as well. R.A. Inman ruth@imwebworks.com
Last Wiki Answer Submitted:  September 16, 2008  3:56 pm  by  Brooklynegg   3,845 pts.
All Answer Wiki Contributors:  Brooklynegg   3,845 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

To rebuild several DB view indexes via LotusScript…

Dim s As New NotesSession
Dim dbThis As NotesDatabase
Dim vCurView As NotesView

Set dbThis = s.CurrentDatabase

Set vCurView = dbThis.GetView(“View 1 Name”)
Call vCurView.Refresh

Set vCurView = dbThis.GetView(“View 2 Name”)
Call vCurView.Refresh

Set vCurView = dbThis.GetView(“View 3 Name”)
Call vCurView.Refresh

 180 pts.

 

Use Updall. That’s what Program documents are for.

 130 pts.

 

Well, using program documents for Updall are indeed much better … at least, if and when you know exactly when you want the view refreshing/rebuilding to take place.

However, if you have a daily scheduled agent that updates thousands of documents and it varies widely in how long it takes, then adding code at the end of that existing LotusScript agent to automatically refresh the views upon agent completion will prevent the next users of the database to get hit with a big delay (while the views’ indexes rebuild/refresh) – and yet will kick off immediately after your agent’s main processing has been completed.

Now … if you know a way to run/call Updall from LotusScript … now THAT would be the best of both worlds. :-)

 180 pts.