Camunda heavy DB Query

I noticed during running a lot of camunda Processes, some heavy queries gets executed in Camunda DB
example:

SELECT SUB.* FROM (
    select  RES.*
    , row_number() over (ORDER BY RES.ID_ asc) rnk FROM ( select distinct RES.* 
     from ACT_RU_EXECUTION RES
      inner join ACT_RU_EXECUTION INST on RES.PROC_INST_ID_ = INST.ID_
    inner join ACT_RE_PROCDEF P on RES.PROC_DEF_ID_ = P.ID_            WHERE  INST.BUSINESS_KEY_ = @P0
        and RES.SUSPENSION_STATE_ = @P1
          and exists (select ID_ from ACT_RU_EVENT_SUBSCR EVT where
          EVT.EXECUTION_ID_ = RES.ID_ and
          EVT.EVENT_TYPE_ = @P2
            and EVT.EVENT_NAME_ = @P3
          ) 
    )RES ) SUB WHERE SUB.rnk >= @P4 AND SUB.rnk < @P5 ORDER BY SUB.rnk 

How can i disable these Camunda queries?

Hi @Hadi_Hoteit1,

This is the execution query with a event subscription filter option (signalEventSubscriptionName or messageEventSubscriptionName). (javadoc)
You can’t disable such queries in the process engine. Maybe you can find first why they are executed (if it’s custom code for example).

Best,
Yana

I don’t have anything in my code calling these functions, the only thing related to Message events is a JS script which just sends a message to the events.
Any ideas on how I can find how this query or function is being called?

You can try to increase the level of some process engine loggers (1), and look at the server log to trace from where are they being called:

  • org.camunda.bpm.engine.cmd
  • org.camunda.bpm.engine.persistence

(1): Logging | docs.camunda.org

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.