Can I rebuild a view index using a LotusScript agent?

5 pts.
Tags:
Lotus Agents
Lotus Notes View
LotusScript
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?
ASKED: September 16, 2008  9:39 AM
UPDATED: September 16, 2008  4:19 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

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: folder\database.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

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • RICHMON
    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 pointsBadges:
    report
  • Ruthie
    Use Updall. That's what Program documents are for.
    130 pointsBadges:
    report
  • RICHMON
    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 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following