This query:
processInstances = historyService
.createHistoricProcessInstanceQuery()
.finishedBefore(minDate.getTime())
.processDefinitionKey(processDefinitionKey)
.orderByProcessInstanceEndTime().asc().list();
Leads to this SQL command:
select RES.*
from ACT_HI_PROCINST RES
inner join ACT_RE_PROCDEF DEF on RES.PROC_DEF_ID_ = DEF.ID_
WHERE DEF.KEY_ = 'ADefKey'
and RES.END_TIME_ <= '2014-06-06 12:12:12'
and RES.END_TIME_ is not NULL
order by END_TIME_ asc
LIMIT 2147483647 OFFSET 0;
When a high load is present, this can lead to long waiting times (with over 80,000 entries -> 500-700 seconds).
This can be reduced to <1 second with this index:
create index PROC_DEF_ID_END_TIME ON ACT_HI_PROCINST (PROC_DEF_ID_,END_TIME_);
This is the controller panel for Smart Panels app
[CAM-2579] Add table index
Summary | Original: Add index for MySQL | New: Add table index |
Link | New: This issue is related to SUPPORT-1184 [ SUPPORT-1184 ] |
Labels | New: AD |
Labels | Original: AD | New: AD SUPPORT |
Fix Version/s | Original: 7.2.0 [ 12997 ] |
Resolution | New: Won't Fix [ 2 ] | |
Status | Original: Open [ 1 ] | New: Closed [ 6 ] |
Workflow | Original: camunda BPM [ 27479 ] | New: Backup_camunda BPM [ 58946 ] |