Status: Closed (View Workflow)
Affects Version/s: 4.1.2
Jira enterprise standalone 4.1.2
Apache tomcat 6.0.20
Introduced in Version:4.01
Bug Fix Policy:
Please please please change CommentClauseQueryFactory.generateIssueIdFromCommentQuery() to use a DocumentHitCollector rather than a for() loop that iterates over Hits.
We're still working on upgrading our Jira 3.13 to 4.1.2.
One thing I noticed was that comment queries were taking forever on my test server when compared to 3.13 running on the same server.
After a day of debugging and testing, I narrowed it down to looping through the Hits in CommentClauseQueryFactory.generateIssueIdFromCommentQuery().
The Hits class is deprecated and states,
I modified our Jira to use a com.atlassian.jira.issue.statistics.util.DocumentHitCollector instead of a for() loop over Hits and our comment queries are now miraculously 6 to 8 times faster.
Here are the statistics for one of my tests before and after the change. For this test I ran comment ~ power which returns about 7000 issues. In Jira 3 I ran the equivalent by putting 'power' into the query box and checking only 'Comments'.
- Before the change
- In Luke, the Lucene query took 3.5 seconds (and without the level restrictions it took 389 ms, which one should consider for another Improvement....)
- In Jira, the Lucene query took the same amount time
- Looping through the issue id's took 74 seconds
- After the change
- Lucene query with hit collection takes 12s