Skip to content

[Bug] [DAO] Workflow execution time increases gradually #9937

@winskin

Description

@winskin

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

说明:耗时随着数据增加而增加,测试耗时从4s增加到20s,只有一个调度任务在跑。
Note: The time-consuming increases as the data increases, the test time increases from 4s to 20s, and only one scheduling task is running.

排查:发现是工作流执行时会查询t_ds_task_instance表,主要的耗时集中在这里,如果能减少查询时间即可降低耗时。
Troubleshooting: It is found that the t_ds_task_instance table is queried when the workflow is executed. The main time-consuming is concentrated here. If the query time can be reduced, the time-consuming can be reduced.

临时解决:t_ds_task_instance表增加索引(当前t_ds_task_instance表数据量为20万)
Temporary solution: add an index to the t_ds_task_instance table (the current data volume of the t_ds_task_instance table is 200,000)

CREATE INDEX t_ds_task_instance_process_instance_id_idx ON t_ds_task_instance (process_instance_id,task_code);

效果:有效提升
Effect: Effectively improve

image

What you expected to happen

耗时降低
time-consuming reduction

How to reproduce

t_ds_task_instance表数据量越大,耗时增加越多
The larger the amount of data in the t_ds_task_instance table, the more time-consuming

Anything else

No response

Version

2.0.5

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Waiting for replyWaiting for replybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions