On DB2, Update removal time of batch job stacktraces results in transaction timeouts #4067
Closed
3 tasks done
Labels
type:bug
Issues that describe a user-facing bug in the project.
version:7.20.5
version:7.21.1
version:7.22.0-alpha1
version:7.22.0
Environment (Required on creation)
Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket)
Batch operation takes too long to complete
Cardinalities:
select count * from ACT_GE_BYTEARRAY
select count * from ACT_GE_BYTEARRAY WHERE NAME_='job.exceptionByteArray'
select count * from ACT_HI_JOB_LOG
select substr(tabname,1,40), card, stats_time from syscat.tables where tabname in ('ACT_GE_BYTEARRAY', 'ACT_HI_JOB_LOG')
ACT_GE_BYTEARRAY
select substr(tabname,1,40), card, stats_time from syscat.tables where tabname in ('ACT_GE_BYTEARRAY', 'ACT_HI_JOB_LOG')
ACT_HI_JOB_LOG
Steps to reproduce (Required on creation)
Observed Behavior (Required on creation)
Transactions timeouts in server log.
Batch is taking longer time to complete even though all jobs are completed. After checking the database logs the execution of
update ACT_GE_BYTEARRAY set REMOVAL_TIME_ = ? where ID_ IN ( SELECT JOB_EXCEPTION_STACK_ID_ FROM ACT_HI_JOB_LOG WHERE JOB_DEF_CONFIGURATION_ = ? )
is taking long time to completeExpected behavior (Required on creation)
No transaction timeouts, the query doesn't slow down batch completion.
Root Cause (Required on prioritization)
With given cardinalities, a full table scan is performed on
ACT_GE_BYTEARRAY
(n=48 935 974
) and no index is used. Query plan:https://jira.camunda.com/browse/SUPPORT-15726?focusedCommentId=328543&focusedId=328543&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-328543
Solution Ideas
For DB2 database: Adjust the query to include
NAME_ = "job.exceptionByteArray"
in theWHERE
clause to filter out queried byte arrays and potentially useACT_IDX_BYTEARRAY_NAME
to speed up query execution. Query plan:https://jira.camunda.com/browse/SUPPORT-15726?focusedCommentId=328543&focusedId=328543&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-328543
Total cost original query:
3.11157e+07
Total cost adjusted query:
2.25563e+06
Total cost reduce: 92.75 % faster
Hints
Links
Breakdown
Pull Requests
Dev2QA handover
The text was updated successfully, but these errors were encountered: