372 Performance Tuning for Content Manager
One way to write this query would be:
//Address[(../@MaritalStatus = 'Married' or ../@MaritalStatus =
'Single')
and ../@Income > 100000 and @State = 'California']
However, this can be quite inefficient because of repeated traversals to the
parent component (Person).
Because the query involves a search based on several attributes
(@MaritalStatus, @Income) in the parent component type, Person, it is a good
idea to search for the parent component first then use an additional step to get to
the Address component.
A more efficient way to write the query would be:
//Person[(@MaritalStatus = 'Married' or @MaritalStatus = 'Single')
and @Income > 100000]/Address[@State = 'California']
Writing the query in the latter form helps the query processor avoid several
redundant joins, which can result in improved performance.
Again, access the Content Manager support Web site for more tips about how to
rewrite an XQuery.
This type of rewrite helps in some cases. However, given the complexity in the
database itself and variation in data, it might not perform better in all cases.
Always test it first before implementing the changes.
12.4.3 Maintain Content Manager database periodically
As we have mentioned many times in this book, it is important to maintain the
Content Manager databases periodically.
For example, in one scenario, it took a Content Manager system more than 30
seconds to return a hit list of 16 documents. The system also became slower
when there were more documents being imported into the Content Manager
system.
In this scenario, the performance issue should be in the Library Server database
because getting a hit list involves only the Library Server. We checked to see how
often the Library Server database was maintained, using tools such as reorg,
runstats, and rebind. We found that it was not maintained periodically. After
running reorg, runstats, and rebind on the Library Server database, the
retrieval performance issue was gone.

Get Performance Tuning for Content Manager now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.