Subject: RE: View Performance - Changing views
Please read this excerpt from an Application Performance document published by IBM a while ago:
Reader name fields can affect view performance. Reader name fields can provide document security, but can have adverse affect on views that display documents that contain reader name fields.For example, suppose you have a Human Resource database for your 10,000 employees and suppose there is a flat view (not categorized) that displays all 10,000 documents. Every employee can see only his/her own document due to Reader Names restrictions. When an employee opens the database, the Domino server sorts through the documents to determine which ones should be shown to the user. Normally, without Reader Names, the first 30 or so documents are displayed to the user, filling the screen. You can do a quick test to confirm this in any database by opening a view and then pressing the down arrow. You scroll quickly for a dozen or so rows; then there is a pause, usually less than a second in duration, while the server grabs another chunk of data to be displayed. The scrolling recommences for 30 or so rows, then another pause occurs, and so on. In the HR application, however, the server is unable to fill the user’s screen with data. That is not a problem, but the server has no way of knowing that it can’t fill the screen, so it continues to sort through all 10,000 documents,looking for more documents that are visible to the user. Finally, exhausting all documents, the server gives up and shows just the one document, but the delay may be considerable. In an isolated environment, the delay might be seconds, but in a real-world production environment, with many users trying to perform a similar task, you can easily have most users timing out because of the delay.
There are a few alternatives that can help you avoid this problem:
- Categorize the view, and initially collapse the categories in the view by selecting the "Collapse all when
database is first opened" option. Although it is true that this setting carries a slight performance hit, in this
situation it produces a great saving.
- Avoid selecting the “Don’t show categories having zero documents” option to show only categories containing
documents. Selecting this option has the same result as using a flat view: The server has to check all 10,000
documents before displaying anything to the user.
- Use an embedded view that displays a single category. Use an @UserName formula to display only the
documents for that user. This is a fantastic performer, and it works brilliantly for Web browsers, too!
Note that the performance issues associated with reader name fields in a view are the same regardless of whether
your users have Web browsers or Notes clients.
HTH
Sai