2 Simple questions on Agents and RemoveAll method

Hi everybody,

  1. I have to execute 2 agents on a Domino Server, one after the other. If I execute a macro (with 2 simple actions) that will run the both, will the second one execute after the first one terminate?

  2. I have also to remove all the documents(about 16000) that are in a view. For the moment, I use the RemoveAll method of the Notesviewentrycollection class, but it takes 20 minutes to excecute this…is there a faster way?

Thx in advance :slight_smile:

Subject: RE: 2 Simple questions on Agents and RemoveAll method

  1. I have to execute 2 agents on a Domino Server, one after the other. If I execute a macro (with 2 simple actions) that will run the both, will the second one execute after the first one terminate?

Your question presupposes that the agents will execute on the Domino server. If the action is activated by a user, the agents will run on the workstation, even if the database is on the server.

Wherever they run, however, they will run sequence, not simultaneously.

  1. I have also to remove all the documents(about 16000) that are in a view. For the moment, I use the RemoveAll method of the Notesviewentrycollection class, but it takes 20 minutes to excecute this…is there a faster way?

I would’ve guessed that RemoveAll was the fastest way, but maybe somebody knows a better one. It might help to set view.AutoUpdate = False before you do this.

If you find yourself often needing to delete 16,000 documents, you might want to reconsider your application design. I most often see this in cases where someone’s doing a mass load of data from some outside datasource into Notes. First they delete thousands of documents from the last data load, then they create thousands of new documents that are nearly all identical to the old documents.

For best performance of your application, it’s much better to find the existing documents by matching some key value, and update them if they’ve changed. Every time you delete a document, it leaves behind a deletion stub. So after 30 days (assuming you load your data daily) you have 16,000 documents and 480,000 invisible deletion stubs cluttering up the place. They will eventually age out (there’s a database setting under replication that affects the time period) but in the meantime they’re a drag on performance and especially on replication.

If you don’t want to write the code, there’s a good example you can swipe in this article: Off-loading Lotus Enterprise Integration tasks to the server. Or you can buy LEI, whose “replication” activity lets you do the whole thing without any programming.

Subject: RE: 2 Simple questions on Agents and RemoveAll method

Andre,

You mention “a impact on performace” with regards to deletion stubs. I understand that deletion stubs will surely have an impact on replication, but I am curious to know as to how it would impact application performance. Yes, using LotusScript, before processing documents, we need to validate whether it is a deletion stub or not. Other than that what other ways could innumerable deletion stubs impact performance? Does it impact indexing of Views? Is there any documentation on that? Appreciate your response.

Thanks

Subject: RE: 2 Simple questions on Agents and RemoveAll method

It always slows things down when there are more “things” in your database, whether those be fields, documents, deletion stubs or whatever. It’s an issue for view indexing because when you open a view, the server has to first update that view index with any changes that have occurred since the last time the view was used. If you just deleted 16,000 documents and added 16,000, that’s 32,000 changes that have to be integrated into the view index the next time it’s used. The server has to examine that many “notes” to see whether the change represents an addition, deletion, or change to the data in the view index. If it’s been several days since the view was used the number rises accordingly. On the other hand, if you wrote a script to compare data and only update the documents that actually need it, there are (let’s say) 90 documents that were changed, 5 added, and 5 deleted.

So, on the one hand, the view has to process 100 changes before it can display; on the other hand, 32,000. Which way does it sound to you like the view will open faster? And there may be many views in the application, many used infrequently, so I pity the user who opens one of those.

Subject: RE: 2 Simple questions on Agents and RemoveAll method

Thanks.

Subject: RE: 2 Simple questions on Agents and RemoveAll method

First of all thanks a lot for your help, I’ll be very usefull.

You were right, my code was to load data from a text file to a temporary domino base, and at the beginning I thought that remove all docs from the base would have been faster than compare each one of them to another…

I’m going to change my LS code as you suggested.

Thanks again!