@DbLookups and @DbColumns are incredibly useful, but they can be quite a
performance drag on a large application. Use these rules of thumb to minimize
the cost of your @Db functions, without reducing functionality.
Minimize the number of @Db functions in any form.
Have @Db functions refer to views on the same database where possible. Keep
your data in one place if not too big.
If there is a group of fields which are returned via @DbLookup, use one
@DbLookup to return a BigField (which contains a list of the contents of all of
those fields), and then parse that field out in your document using @Word.
Look up a column number, not a field name or column name.
Use the "NoCache" option whenever it won't affect logic of the lookup. This
option has no effect on the HTTP (web) server.
For documents which are often just read (as opposed to almost always being
edited), you should use @IsDocBeingLoaded as part of the formula, or put the
@Db functions into buttons, not into fields.
Use column number instead of field name for DbLookup and DbColumn calls.
Looking up by FieldName requires the lookup to go into the document and find
the field. Column number allows the lookup to pull the value directly off the
view index, which is much faster.
When trapping for lookup errors, load the lookup result into a temporary
variable to check for
Requires Free Membership to View
Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.
example:
_ret := @DbLookup("":"NoCache"; ""; "my view"; ProjectName; 2);
@If(@isError(ret); "Error: Could not find Project " +ProjectName+ ". Please
create one."; _ret)
This was first published in November 2000