IBM®
Skip to main content
    Country/region select      Terms of use
 
 
   
     Home      Products      Services & solutions      Support & downloads      My account     

developerWorks  >  Lotus  >  Forums & community  >  Best Practice Makes Perfect

Best Practice Makes Perfect

A collaboration with Domino developers about how to do it and how to get it right in Domino

The main thing slowing down a lot of applications is all the keyword lookups on the forms. I've written elsewhere about intelligent use of caching in these lookups, but there's another aspect I forgot to mention.

The data in keyword lookup views, in most cases doesn't change very often. But every time you refer to the view in an @DbLookup or @DbColumn, the view indexer still has to check to make sure the view is up to date; every document that's been modified or created since the view was last used has to be compared against the view selection formula to see whether it should be included, even though, as the developer of the application, you know that the answer is probably "no". But there are lots of other documents getting modified in the application all the time, so there are always some that need to be checked. Even if no documents have been modified, it still takes a little time to check that no documents were modified. Hence the delay.

To improve performance of these lookups, it often makes sense to set the view indexing options to not bother to reindex the view every time it's used. The view property box offers an option to re-index "Auto, at most every x hours" where x is a number you specify. Set this to, say, 3 hours, and most of the time the form will work faster because users will not have to wait for the view to re-index. Every three hours (or whatever you specify) the refresh will still happen and might take longer than it would've if the index were being updated all the time. But the average will be lower, and since you often do multiple lookups on a given form, a single user is unlikely to be unfortunate enough to hit the refresh interval on all the lookup views. Especially if you write an agent to run at 6:30 AM and refresh all the lookup views to prevent the early-bird employee getting socked with the whole load. Actually this is not a bad idea to do for other views, either.

When you do edit the keyword documents, you can force a refresh using LotusScript code in the Postopen event of the keyword form. This affects only the replica you're in at the time, but cases where a new keyword value is needed immediately by someone other than the person who created it, are rare, so the indexing delay, added to the usual replication delay, should not be a big deal. Just put some static text on the keyword form reminding the person doing the editing that it may take up to n hours for all users to see the new keyword. If the update is needed by a user on a particular server, they can do the editing on that server (or you can give them a handy button to reach across to another server to refresh its views, if you like).

(Incidentally, setting an index to Manual refresh is probably a bad idea in an application which is not entirely read-only. You can manually refresh the index in one replica when there's a change to the data, but if there are any other replicas, this will not help them).

Andre Guirard | 31 January 2008 07:00:00 AM ET | Plymouth, MN, USA | Comments (8)

Search this blog 

Disclaimer 

    About IBM Privacy Contact