Performance-tuning Lotus Notes applications is more an art than a science,
And there are probably hundreds of causes for slowness in a database. However,
When you're looking at an application that's not properly Ming well there are
Handful of common places to look first. Here are 10 things that seem to come up
- Notesview. AutoUpdate.Opening a notesview and
Stepping through the documents to find or gather information is an incredibly
Common task. One of the best things you can do to improve the speed of walking
The view, especially if you are modifying or deleting documents, is to set
Notesview. AutoUpdate property to false after you open the view and before you
Start getting documents. For example:
Set view = dB. getview ("myspecialview") view. AutoUpdate = falseset Doc = view. getfirstdocument
- use notesviewentry for view lookups. using notesviewentry and notesviewentrycollection can be significantly faster than
using notesdocuments to walk through views or do
lookups. this is because you are accessing the View index directly (already
built) instead of having to access each document individually. if you're looking
for specific information about each document (like field data ), you will only
see the real speed improvements if you use notesviewentry. columnvalues instead of getting the document object and looking up the field from there.
- cache your notesview references in code. while
we're on the subject of notesviews , another thing
You shoshould do is cache any notesview objects that
you need to use more than once, rather than opening the same view multiple
times. opening a database and/or a view takes a very long [relative] time, So
you only want to do it once per agent/script Library/form. pass the notesview by reference to functions, or use global
variables if you must.
- watch out for excessive string concatenations or array building. string
concatenations only get to be a burden if you're doing thousands and thousands
of concatenations. if you are doing that handle, the process slows significantly.
I posted some performance comparisons a few years ago on my
If You're building arrays, fixed size arrays are fastest, dynamic
arrays are slightly slower (use redim as little as
possible ), and arrayappend can be extremely slow if
you use it in a loop. you shoshould also consider using lists instead of arrays in
- Only useReaders FieldsIf you really have.
Readers FieldsAre a very convenient way to lock
Down access to events in a database. However, they can cause a database
Respond very slowly when you open a view (Notes client or Web). This is because
The view has to check whether you have access to a document before it can
Display it in the view, which is much less efficient than just reading through
The View index. Here's an article on developerworks; it's pretty old but describes
Problem (and some possible solutions ).
- Check your view indexes. You can easily check the size of all the view
Indexes in a database by issuing "Show Database
[Dbname]" Command at the server console, or if you don't have access
The console, the server's log. nsf file shoshould have that information in
Database usage documents. In general, the larger the View index, the slower
View will be to open, re-index, and use programmatically. Index size and speed
Is a reflection of how many columns in the view are indexed, how efficient
View Selection Formula is, how complex the column formulas are (especially
Indexed columns, although they all play a part), and how many columns there are.
Interestingly, Andrew Pollack recently found that using @ Isresponsedoc Instead @ Alldescendents In a view formula made the index over 150
@ NowAnd@ TodayAre big performance drains when used in view
Selection and column formulas too, but you probably knew that already.
- Excessive@ DblookupsOn forms. I still see this
Problem all the time: forms that use the same@ DblookupIn multiple places, or forms that have dozens
@ Dblookups(Often withNocache flagSet). poor use@ DblookupsCan cause forms to take forever to open. You
Shocould reuse lookup results whenever possible, cache the lookups when it makes
Sense, and define lidate lookups that are using the same view by creating a column
With all the lookup values as a delimited string. Here are some articles and
Information to get you started:
Http://www-10.lotus.com/ldd/bpmpblog.nsf/dx/caching-strategy? OpenDocument & comments
- Excessive Form/Page refreshes. There is a notes
Form property "Automatically refresh fields ."
You almost never want this to be set. This will recalculate all the fields on
The form whenever a field value changes, which normally happens quite a bit.
I 've seen forms with a lot of field calculations and lookups that were almost
Unusable because the form keeps refreshing going from field to field. Refreshes
Can also be triggered by code in field events or the field property "Refresh fields on keyword change" That can be set
Some field types. Sometimes refreshing the form fields is good, but use it only
When you have to. Also keep in mind that if you are using Notesuidocument object , Autoreload Property Defaults "True ." You can set it "False" If you don't need it.
On the web, try to do
Nice "partial refresh" options.
- tune up your ODBC queries. sometimes it's not your database that's slow,
it's the interaction with other systems. if you're doing ODBC queries against
external data sources (using ls: Do, Lei, ADO, or JDBC ), check how long it takes
just to do the SQL lookup in the first place. if the SQL query is overly broad
or complex, you might be able to refine it or work with your DBA to create a
special lookup table. also, check the fetch batch size and result caching
options of your ODBC connections to make sure you're fetching more than one row
at a time when stepping through a result set.
- Smaller is better. Simplify your databases. prefer smaller forms-fewer
Fields, fewer and less complex tables, fewer subforms, fewer hide-When Formulas
-To larger ones. prefer two or three small views to one large one. Remove views
You don't use. Make sure your lookup views have the smallest number
Computations, columns, and indexes as possible. Don't maintain unread marks or
Full-text index on a database if you don't need them. Archive old documents ents
Another database. If you have a lot of frequently deleted documents due to daily
Data refreshes or similar processes, consider purging the deletion stubs more
Often than the default (search the lotus distributed tes or forums for "purge
Interval "to find out how ).
For Ideas on other ways you can performance-tune your notes applications,
Here are a few places to start looking:
Jamie Magee's performance
Buchan's Best Practices sessions