Suggestions to speed up evaluate(@dblookup...)?

I am creating a user activated Lotus Script Agent that does multiple evaluate(@dblookup…)'s on a view to populate a variant.

total=Evaluate(|@dblookup(“”;“”:“”;“TopDownTotals_Export”;“| + customerList(x) + |” ;2)|)

The view has a selection formula that contains a variable created from an @today command.

currentYear:=@year(@now);

The variable, currentYear, is used in the rest of the view selection formula.

SELECT (@Left(Status ; 3) = “Com” | Status = “Bond” | Status = “Hold For Art” | @Left(Status ; 2) = “In” | Status = “Out For Approval” | Status = “Printing” | Status = “Top Coat” | @Left(Status ; 4) = “Wait”) & @Year(@Date(@If(@IsText(DateIn) ; @TextToTime(DateIn) ; DateIn))) = currentYear

My problem is that the agent slows painfully down while doing the evaluate(@dblookup…).

I know that the @today command is at least partially to blame. When I change it to a constant (currentYear:=2005, the lookups go from 15-25 seconds each to 3-5 seconds each.

Still too slow though since the agent will be doing a lookup over 400 times to create a spreadsheet on demand. Plus, I really need this view to be dynamic in selecting only the current years documents.

The view only contains 4,200 documents. Is there something I can do, or another way to approach this to obtain faster lookups in this Agent?

Thank you for any help.

Subject: Suggestions to speed up evaluate(@dblookup…) ?

First thing I’d do is stop using evaluate(@dblookup…

Is there any reason you can’t use the getallentriesbykey method of a notesview? You don’t say what you do with the return value but you can use viewentry.columnvalues to return the same data from the view as the dblookup returns. I’d expect this to be quicker.

Also, to help the view up you could create a currentyear field on the documents. This could be computed for when the documents are created/edited, and then once a year run an agent to change the field of those documents which are no longer current year or are now current year.

hth

Dan

Subject: Suggestions to speed up evaluate(@dblookup…) ?

Do not use @Today or @Now in views. They will be very slow. Better to use a schedulet agent that updates all documents with a “Today” or “Now” field, and change the SELECT accordingly.Take a peak at appendix B-1 in “Performance considerations for Domino applications”:

http://www.redbooks.ibm.com/redbooks/pdfs/sg245602.pdf

  • Johan

johan@kanngard.net

http://dev.kanngard.net