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

While I'm thinking about indexing options...

One thing I don't recall having seen mentioned previously is the effect of indexing options on views that use @Today or @Now. These views are a performance issue (in case you didn't know) because the view index is always considered out of date, so every time a user opens it, the index is discarded and created fresh, which takes a lot longer than just updating an existing index with any documents created or modified since last use.

If you do have a view that uses @Today, and you want to improve the performance without doing a lot of work, you can just set the indexing options to refresh "Auto, at most every x hours," with a reasonable value for x depending on the needs of your application -- say, 6 hours, so you know it's always up to date with today's data by 6 AM. This might not be suitable for all applications -- it depends how likely the documents are to change during the day and how important it is that such changes show in the view immediately. Bear in mind that users can update the view manually via F9 whenever they wish (if they were about to take a coffee break anyway), and you can also programmatically refresh the view using NotesView.Refresh (e.g. in a server agent that runs when documents are modified) so that at least your users don't have to wait for it.

@Now is more problematic than @Today because it really does generally need to be up to the minute (e.g. red-flag requests that are more than 2 hours old), so in that case you may either have to accept the performance hit, or come up with a different way to satisfy the requirement (e.g. agent sends urgent email to someone when the request is old).

Andre Guirard | 1 February 2008 07:00:00 AM ET | Plymouth, MN, USA | Comments (5)


 Comments

1) Here are some examples of the effect of @Today/@Now
Jamie Magee | 2/1/2008 8:26:20 AM

{ Link }

This is a great topic, and there are several ways to handle it.

2) Caching
Mikkel Heisterberg | 2/1/2008 12:44:46 PM

When speaking of @Today and @Now. A while back I read and posted something about new @functions for Notes 8.0.1 on my blog (see { Link } ) based on some stuff from Rocky. Apparently in Notes 8.0.1 there will be a @Now([NoCache]) version of the @Now function to force a refresh of the date/time. Otherwise data would be cached. Do you know anything of this?

Based on what you write it seems like that wont make it.

3) my understanding of @Now([NoCache])...
Charles Robinson | 2/1/2008 4:26:54 PM

Is that it has to do with whether the call forces a server transaction or not. This has nothing to do with view indexing or document caching, just how @Now is calculated.

4) @text(@created;"S3")="Today"
Alan Bell | 2/6/2008 6:11:32 AM

@text(SomeValueOnTheNote,"S3") will return "Today" if it is today, with @adjust and @explode you can do tests for date ranges. The server doesn't see this as a time related formula so it doesn't mark the index as constantly out of date. You do need to discard the index each night to let it rebuild though, but when it does you can use full auto indexing.

5) @Today in Select Formulas
Dietmar Dumke | 2/6/2008 12:46:02 PM

For view selection formula containing @Today, you can overwrite the original selection formula by replacing @Today with the current date. Best done using a scheduled agent running once a day.

6) re: @Today in Select Formulas
Andre Guirard | 2/7/2008 9:02:45 AM

That has been discussed here before, and it's generally been agreed that updating the selection formula daily is a good option for a lot of cases. You can improve on this by setting the indexing options to "Automatic" rather than the default "Auto, on first use," so that the first person to use the view in the morning doesn't get socked with a total index rebuild.

 Add a Comment
Subject:
   
Name:
Comment:  (No HTML - Links will be converted if prefixed http://)
 
Remember Me?     Cancel

Search this blog 

Disclaimer 

    About IBM Privacy Contact