• Icon: Feature Request Feature Request
    • Resolution: None
    • Icon: L3 - Default L3 - Default
    • None
    • 7.15.0
    • engine
    • None

      User Story (Required on creation):

      Improve performance of Camunda engine when using SQL server.

      I posted details in Camunda forum but with no response, see SQL server - performance improvements - Process Engine - Camunda Platform Forum

      Functional Requirements (Required before implementation):

      Technical Requirements (Required before implementation):

      Limitations of Scope (Optional):

      Hints (Optional):

        This is the controller panel for Smart Panels app

            [CAM-13529] SQL server - performance improvements

            Hi PetrF,

            Thank you for reaching out to us with this request.

            Please keep in mind that we are providing support for different databases, versions and setups (small nodes and large clusters) - Supported environments.
            Whenever we evaluate improvements in the database environments, we try to make an informative decision considering all scenarios and based on concrete data.
            As next step I would like to ask you to provide further details so we can evaluate the suggested improvements:

            1. Could you please share more information for your setup:
              • What is the architecture - do you have a cluster environment, how many nodes, etc.
              • What is your jdbc driver? You mentioned using SQL Server 2018, is that correct?
            2. Could you please share cardinalities for the specified query [1] - number of entries in ACT_RU_EXT_TASK, ACT_RU_EXECUTION, ACT_RE_PROCDEF tables
            3. Please upload explain plan without and with the improvement of the query
              • Current query
                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_ 
                			WHERE (RES.LOCK_EXP_TIME_ is null or RES.LOCK_EXP_TIME_ <= @LockExpTime) 
                			  and (RES.SUSPENSION_STATE_ is null or RES.SUSPENSION_STATE_ = 1) 
                			  and (RES.RETRIES_ is null or RES.RETRIES_ > 2) 
                			  and ( RES.TOPIC_NAME_ like '%' ) 
                		) RES 
                	)RES 
                ) SUB 
                WHERE SUB.rnk >= @start AND SUB.rnk < @end ORDER BY SUB.rnk
                
              • Suggested improvement
                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_ 
                	WHERE (RES.LOCK_EXP_TIME_ is null or RES.LOCK_EXP_TIME_ <= @LockExpTime) 
                		and (RES.SUSPENSION_STATE_ is null or RES.SUSPENSION_STATE_ = 1) 
                		and (RES.RETRIES_ is null or RES.RETRIES_ > 2) 
                		and (RES.TOPIC_NAME_ like '%') 
                ) RES 
                ORDER BY RES.PRIORITY_ desc
                OFFSET @start ROWS 
                FETCH NEXT @end - @start ROWS ONLY
                

            [1]: https://forum.camunda.org/t/sql-server-performance-improvements/26587/3

            Best regards,
            Yana

            Yana Vasileva added a comment - Hi PetrF , Thank you for reaching out to us with this request. Please keep in mind that we are providing support for different databases, versions and setups (small nodes and large clusters) - Supported environments . Whenever we evaluate improvements in the database environments, we try to make an informative decision considering all scenarios and based on concrete data. As next step I would like to ask you to provide further details so we can evaluate the suggested improvements: Could you please share more information for your setup: What is the architecture - do you have a cluster environment, how many nodes, etc. What is your jdbc driver? You mentioned using SQL Server 2018, is that correct? Could you please share cardinalities for the specified query [1] - number of entries in ACT_RU_EXT_TASK, ACT_RU_EXECUTION, ACT_RE_PROCDEF tables Please upload explain plan without and with the improvement of the query Current query 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_ WHERE (RES.LOCK_EXP_TIME_ is null or RES.LOCK_EXP_TIME_ <= @LockExpTime) and (RES.SUSPENSION_STATE_ is null or RES.SUSPENSION_STATE_ = 1) and (RES.RETRIES_ is null or RES.RETRIES_ > 2) and ( RES.TOPIC_NAME_ like '%' ) ) RES )RES ) SUB WHERE SUB.rnk >= @start AND SUB.rnk < @end ORDER BY SUB.rnk Suggested improvement 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_ WHERE (RES.LOCK_EXP_TIME_ is null or RES.LOCK_EXP_TIME_ <= @LockExpTime) and (RES.SUSPENSION_STATE_ is null or RES.SUSPENSION_STATE_ = 1) and (RES.RETRIES_ is null or RES.RETRIES_ > 2) and (RES.TOPIC_NAME_ like '%' ) ) RES ORDER BY RES.PRIORITY_ desc OFFSET @start ROWS FETCH NEXT @end - @start ROWS ONLY [1] : https://forum.camunda.org/t/sql-server-performance-improvements/26587/3 Best regards, Yana

            Closing due to inactivity from reporter's side.
            Feel free to reopen the ticket in case you collected the requested information or any further questions.

            Yana Vasileva added a comment - Closing due to inactivity from reporter's side. Feel free to reopen the ticket in case you collected the requested information or any further questions.

              Unassigned Unassigned
              PetrF Petr Formanek
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: