Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-2579

Add table index

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Won't Fix
    • Icon: L3 - Default L3 - Default
    • None
    • None
    • engine

      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

              Unassigned Unassigned
              matthijs.burke Matthijs
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: