Hello everyone, I’m using Camunda 7.21 with the LDAP plugin. However, I have externalized the task list to my custom frontend, so only a small number of admin users are actually involved with Cockpit.
I have noticed that in the authorization tables in the database, a record is created for every single task assigned to a user, granting the user permissions to: READ and TASK_WORK on the task resource with the given ID. Since I have a large number of users and user tasks, when my external task worker invokes fetch and lock, a join is performed on the authorization table, which takes quite a bit of time (the sample below takes about 10 seconds).
Is there a way to avoid, limit, or exclude the creation of permissions on the ACT_RU_AUTHORISATION
table for user tasks since I don’t need it?
SELECT SUB.* FROM ( select RES.* , row_number() over (ORDER BY RES.PRIORITY_ desc) rnk FROM ( select distinct RES.* from ( select RES.*, PI.BUSINESS_KEY_, PD.VERSION_TAG_ from ACT_RU_EXT_TASK RES left join ACT_RU_EXECUTION PI on RES.PROC_INST_ID_ = PI.ID_ inner join ACT_RE_PROCDEF PD on RES.PROC_DEF_ID_ = PD.ID_ left join ( SELECT A.* FROM ACT_RU_AUTHORIZATION A WHERE A.TYPE_ < 2 AND ( A.USER_ID_ in ( @P0, '*') OR A.GROUP_ID_ IN ( @P1 , @P2 ) ) ) AUTH ON ( (AUTH.RESOURCE_TYPE_ = 8 AND (AUTH.RESOURCE_ID_ IN ( RES.PROC_INST_ID_ , '*' )) AND AUTH.PERMS_ &2 = 2) OR (AUTH.RESOURCE_TYPE_ = 6 AND (AUTH.RESOURCE_ID_ IN ( RES.PROC_DEF_KEY_ , '*' )) AND AUTH.PERMS_ &512 = 512) ) left join ( SELECT A.* FROM ACT_RU_AUTHORIZATION A WHERE A.TYPE_ < 2 AND ( A.USER_ID_ in ( @P3, '*') OR A.GROUP_ID_ IN ( @P4 , @P5 ) ) ) AUTH1 ON ( (AUTH1.RESOURCE_TYPE_ = 8 AND (AUTH1.RESOURCE_ID_ IN ( RES.PROC_INST_ID_ , '*' )) AND AUTH1.PERMS_ &4 = 4) OR (AUTH1.RESOURCE_TYPE_ = 6 AND (AUTH1.RESOURCE_ID_ IN ( RES.PROC_DEF_KEY_ , '*' )) AND AUTH1.PERMS_ &1024 = 1024) ) WHERE (RES.LOCK_EXP_TIME_ is null or RES.LOCK_EXP_TIME_ <= @P6) and (RES.SUSPENSION_STATE_ is null or RES.SUSPENSION_STATE_ = 1) and (RES.RETRIES_ is null or RES.RETRIES_ > 0) and ( RES.TOPIC_NAME_ = @P7 ) AND AUTH.RESOURCE_ID_ IS NOT NULL AND AUTH1.RESOURCE_ID_ IS NOT NULL ) RES )RES ) SUB WHERE SUB.rnk >= @P8 AND SUB.rnk < @P9 ORDER BY SUB.rnk