Long running internal queries on Flowable making it unresponsive

Hi,

Flowable engine is being unresponsive for us. On the Flowable logs, I see there are these huge number of entries of SQL logs of the kind mentioned below :

select C.*, P.ID_ as PI_ID_, P.REV_ as PI_REV_, P.CASE_DEF_ID_ as PI_CASE_DEF_ID_, P.DERIVED_CASE_DEF_ID_ as PI_DERIVED_CASE_DEF_ID_, P.CASE_INST_ID_ as PI_CASE_INST_ID_, P.STAGE_INST_ID_ as PI_STAGE_INST_ID_, P.IS_STAGE_ as PI_IS_STAGE_, P.ELEMENT_ID_ as PI_ELEMENT_ID_, P.ITEM_DEFINITION_ID_ as PI_ITEM_DEFINITION_ID_, P.ITEM_DEFINITION_TYPE_ as PI_ITEM_DEFINITION_TYPE_, P.NAME_ as PI_NAME_, P.STATE_ as PI_STATE_, P.CREATE_TIME_ as PI_CREATE_TIME_, P.LAST_AVAILABLE_TIME_ as PI_LAST_AVAILABLE_TIME_, P.LAST_ENABLED_TIME_ as PI_LAST_ENABLED_TIME_, P.LAST_DISABLED_TIME_ as PI_LAST_DISABLED_TIME_, P.LAST_STARTED_TIME_ as PI_LAST_STARTED_TIME_, P.LAST_SUSPENDED_TIME_ as PI_LAST_SUSPENDED_TIME_, P.COMPLETED_TIME_ as PI_COMPLETED_TIME_, P.OCCURRED_TIME_ as PI_OCCURRED_TIME_ , P.TERMINATED_TIME_ as PI_TERMINATED_TIME_, P.EXIT_TIME_ as PI_EXIT_TIME_, P.ENDED_TIME_ as PI_ENDED_TIME_, P.START_USER_ID_ as PI_USER_ID_, P.REFERENCE_ID_ as PI_REFERENCE_ID_, P.REFERENCE_TYPE_ as PI_REFERENCE_TYPE_, P.IS_COMPLETEABLE_ as PI_IS_COMPLETEABLE_, P.ENTRY_CRITERION_ID_ as PI_ENTRY_CRITERION_ID_, P.EXIT_CRITERION_ID_ as PI_EXIT_CRITERION_ID_, P.EXTRA_VALUE_ as PI_EXTRA_VALUE_, P.IS_COUNT_ENABLED_ as PI_IS_COUNT_ENABLED_, P.VAR_COUNT_ as PI_VAR_COUNT_, P.SENTRY_PART_INST_COUNT_ as PI_SENTRY_PART_INST_COUNT_, P.TENANT_ID_ as PI_TENANT_ID_, CASE_DEF.KEY_ as CaseDefinitionKey, CASE_DEF.NAME_ as CaseDefinitionName, CASE_DEF.VERSION_ as CaseDefinitionVersion, CASE_DEF.DEPLOYMENT_ID_ as CaseDefinitionDeploymentId from ACT_CMMN_RU_CASE_INST C inner join ACT_CMMN_CASEDEF CASE_DEF on C.CASE_DEF_ID_ = CASE_DEF.ID_ left join ACT_CMMN_RU_PLAN_ITEM_INST P on C.ID_ = CASE_INST_ID_ and P.ENDED_TIME_ is null WHERE C.ID_ = (select CASE_INST_ID_ from ACT_CMMN_RU_PLAN_ITEM_INST where ID_ = ?)

Queries of this kind are taking really long, up to a minute each to execute and at any given point in time there are a huge number of these logs. Probably due to this, Flowable has been unresponsive, workflows are getting stuck forever.
I think these queries are internal to Flowable, not sure what the queries are trying to do ultimately. Is there a way to disable these queries if they are not important?