ExcludeCount and performance
Background
I am doing some load testing on an HPRM dataset containing 16 million records. Response times from our web clients were not great, depending on which search query I used of course. I really wanted to improve this.
ExcludeCount
A ServiceAPI parameter not often mentioned is ExcludeCount (otherwise known as resultsOnly). This has the effect of committing the SearchTitle and TotalResults properties from the response. Total results in particular can degrade performance on a large dataset as it calculates the total number of records matched by the query.
ServiceAPI Example
http://[myserver]/HPRMServiceAPI/Record?q=uri:2013778,1208882,1380177,1542060,1378119&format=json&Excludecount=true
WebDrawer Example
Setting ExcludeCount as the default in WebDrawer will result in the search results page no longer displaying the search title. To do this add the 'resultsOnly' attribute in the Record route defaults, as seen below. Ensure you set this on the route named Record with the model named Records.
<add name="Record" model="Records" template="WDRecordList" properties="RecordRecordType,RecordExtension,RecordTitle,RecordNumber" pageSize="15" resultsOnly="true"/>
The outcome
On my large dataset ExcludeCount more than halved the response time on many requests.
The Cost
In WebDrawer the cost is that the page number links no longer work. This post examines a solution to the broken paging problem.