Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JBPM-10100] [GSS] (7.12.0) Select from PROCESSINSTANCELOG takes too long #1554

Merged
merged 1 commit into from Aug 1, 2022

Conversation

elguardian
Copy link
Member

@elguardian
Copy link
Member Author

Jenkins run fdb

Copy link
Member

@gmunozfe gmunozfe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something regarding format and also a question about indexes when grouping.

@@ -2,7 +2,7 @@
{
"query-name": "jbpmProcessInstances",
"query-source": "${org.kie.server.persistence.ds}",
"query-expression": "select log.processInstanceId, log.processId, log.start_date, log.end_date, log.status, log.parentProcessInstanceId, log.outcome, log.duration, log.user_identity, log.processVersion, log.processName, log.correlationKey, log.externalId, log.processInstanceDescription, log.sla_due_date, log.slaCompliance, COALESCE(info.lastModificationDate, log.end_date) as lastModificationDate, (select COUNT(errInfo.id) from ExecutionErrorInfo errInfo where errInfo.PROCESS_INST_ID=log.processInstanceId and errInfo.ERROR_ACK=0) as errorCount from ProcessInstanceLog log left join ProcessInstanceInfo info on info.InstanceId=log.processInstanceId",
"query-expression": "SELECT log.processInstanceId, log.processId, log.start_date, log.end_date, log.status, log.parentProcessInstanceId, log.outcome, log.duration, log.user_identity, log.processVersion, log.processName, log.correlationKey, log.externalId, log.processInstanceDescription, log.sla_due_date, log.slaCompliance, COALESCE ( info.lastModificationDate, log.end_date ) AS lastModificationDate, COUNT( errInfo.id ) errorCount FROM ProcessInstanceLog log INNER JOIN ExecutionErrorInfo errInfo ON errInfo.Process_Inst_Id=log.processInstanceId AND errInfo.ERROR_ACK=0 LEFT JOIN ProcessInstanceInfo info ON info.InstanceId=log.processInstanceId GROUP BY log.processInstanceId, log.processId, log.start_date, log.end_date, log.status, log.parentProcessInstanceId, log.outcome, log.duration, log.user_identity, log.processVersion, log.processName, log.correlationKey, log.externalId, log.processInstanceDescription, log.sla_due_date, log.slaCompliance, COALESCE ( info.lastModificationDate, log.end_date ) HAVING COUNT( errInfo.id ) > 0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep the same "capitalization" for all the columns, shouldn't it be

  • process_Inst_Id vs. Process_Inst_Id
  • error_Ack vs. ERROR_ACK
  • instanceId vs. InstanceId

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no need for that

@@ -2,7 +2,7 @@
{
"query-name": "jbpmProcessInstances",
"query-source": "${org.kie.server.persistence.ds}",
"query-expression": "select log.processInstanceId, log.processId, log.start_date, log.end_date, log.status, log.parentProcessInstanceId, log.outcome, log.duration, log.user_identity, log.processVersion, log.processName, log.correlationKey, log.externalId, log.processInstanceDescription, log.sla_due_date, log.slaCompliance, COALESCE(info.lastModificationDate, log.end_date) as lastModificationDate, (select COUNT(errInfo.id) from ExecutionErrorInfo errInfo where errInfo.PROCESS_INST_ID=log.processInstanceId and errInfo.ERROR_ACK=0) as errorCount from ProcessInstanceLog log left join ProcessInstanceInfo info on info.InstanceId=log.processInstanceId",
"query-expression": "SELECT log.processInstanceId, log.processId, log.start_date, log.end_date, log.status, log.parentProcessInstanceId, log.outcome, log.duration, log.user_identity, log.processVersion, log.processName, log.correlationKey, log.externalId, log.processInstanceDescription, log.sla_due_date, log.slaCompliance, COALESCE ( info.lastModificationDate, log.end_date ) AS lastModificationDate, COUNT( errInfo.id ) errorCount FROM ProcessInstanceLog log INNER JOIN ExecutionErrorInfo errInfo ON errInfo.Process_Inst_Id=log.processInstanceId AND errInfo.ERROR_ACK=0 LEFT JOIN ProcessInstanceInfo info ON info.InstanceId=log.processInstanceId GROUP BY log.processInstanceId, log.processId, log.start_date, log.end_date, log.status, log.parentProcessInstanceId, log.outcome, log.duration, log.user_identity, log.processVersion, log.processName, log.correlationKey, log.externalId, log.processInstanceDescription, log.sla_due_date, log.slaCompliance, COALESCE ( info.lastModificationDate, log.end_date ) HAVING COUNT( errInfo.id ) > 0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question: none of these are indexes to group based on them:
log.sla_due_date, log.slaCompliance, info.lastModificationDate
Should it affect performance?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not it should not as you are not ordering by those.

@elguardian elguardian merged commit 77f35fb into kiegroup:main Aug 1, 2022
@elguardian elguardian deleted the JBPM-10100 branch August 1, 2022 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants