Bad performance noticed on issues with long history

2015-10-21T17:33:26
ID ATLASSIAN:JRASERVER-45903
Type atlassian
Reporter rrosa@atlassian.com
Modified 2018-10-11T06:41:09

Description

{panel:bgColor=#e7f4fa} NOTE: This suggestion is for JIRA Server. Using JIRA Cloud? [See the corresponding suggestion|http://jira.atlassian.com/browse/JRACLOUD-45903]. {panel}

Performing some testing with JIRA 6.4.5, I've noticed that there is a huge difference when logging work on an issue with no history and on an issue with a long history.

I enabled Profiling on JIRA to check the difference:

Example 1: Issue with 858 entries on history:

{noformat} 2015-10-21 15:18:53,596 http-bio-8080-exec-21 DEBUG sysadmin 918x163x1 1zsbpp 0:0:0:0:0:0:0:1 /secure/CreateWorklog.jspa [atlassian.util.profiling.UtilTimerStack] [6104ms] - /secure/CreateWorklog.jspa [0ms] - PermissionManager.hasPermission() [6100ms] - CreateWorklog.execute() [1ms] - PermissionManager.hasPermission() [1ms] - PermissionManager.hasPermission() [0ms] - PermissionManager.hasPermission() [0ms] - PermissionManager.hasPermission() [0ms] - PermissionManager.hasPermission() [0ms] - PermissionManager.hasPermission() [44ms] - IssueIndexManager.reIndexIssueObjects() [1ms] - PermissionManager.hasPermission() [11ms] - IssueIndexManager.reIndexWorklogs() {noformat}

Example 2: Issue with 4 entries on history:

{noformat} 2015-10-21 15:21:44,662 http-bio-8080-exec-24 DEBUG sysadmin 921x169x1 1zsbpp 0:0:0:0:0:0:0:1 /secure/CreateWorklog.jspa [atlassian.util.profiling.UtilTimerStack] [189ms] - /secure/CreateWorklog.jspa [0ms] - PermissionManager.hasPermission() [186ms] - CreateWorklog.execute() [0ms] - PermissionManager.hasPermission() [0ms] - PermissionManager.hasPermission() [0ms] - PermissionManager.hasPermission() [0ms] - PermissionManager.hasPermission() [0ms] - PermissionManager.hasPermission() [0ms] - PermissionManager.hasPermission() [37ms] - IssueIndexManager.reIndexIssueObjects() [0ms] - PermissionManager.hasPermission() [9ms] - IssueIndexManager.reIndexWorklogs() [1ms] - PermissionManager.getProjects() {noformat}

h3. Notes It further degrade the performance of the instance and it takes longer to load issues with large history items * SQL to identify issues with large {{worklog}} history: {code:borderStyle=solid} select issueid, count(id) from worklog group by issueid having count(id) > 100 order by (count(id)) desc; {code} * SQL to find large number of {{jiraaction}} (comments ... ) per issue: {code:SQL|borderStyle=solid} select a.issueid, count(a.id) from jiraaction a group by a.issueid order by count (a.id) DESC; {code} ** With join {code:SQL|borderStyle=solid} select concat(p.pkey,'-',i.issuenum) as issue, count(a.id) from jiraaction a, jiraissue i, project p where i.project = p.id and i.id = a.issueid group by p.pkey,i.issuenum order by count (a.id) DESC; {code}