-
Notifications
You must be signed in to change notification settings - Fork 5k
[Improvement-17755][Dao] Optimize pagination query performance of projects/workflow-instances/task-instances #17756
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
base: dev
Are you sure you want to change the base?
Conversation
|
Thanks for opening this pull request! Please check out our contributing guidelines. (https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md) |
SbloodyS
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please describe what issues you have encountered so that everyone can understand clearly what problems this PR has solved. @fanzhenyu95
|
Adding indexes alone won't solve all problems; we still need to optimize some query methods to achieve better results. Please first describe which interfaces you are currently experiencing slow query issues with. |
|
@SbloodyS @ruanwenjun Thank you for your feedback! The pagination queries for project list, workflow instance list, and task instance list are significantly slow in production environments with large datasets, leading to long page loading times and poor user experience. Frequently used interfaces with slow query performance include:
While adding indexes alone may not solve all performance issues, in our specific scenario with tables containing millions of records, list queries were taking over 10 seconds to execute and sometimes even failed to return results. After implementing the proposed indexes, all list queries now perform normally with acceptable response times. |
a31ac50 to
2c95045
Compare
|
@fanzhenyu95 Thanks for the clarification. I've updated the issue and PR titles. |
SbloodyS
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Schema Check failed. Please fix it. @fanzhenyu95
|
SbloodyS
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Schema Test failed. Please fix it. @fanzhenyu95



Purpose of the pull request
close #17755
Brief change log
Add the following indexes to improve the pagination query performance:
For
t_ds_workflow_instancetable:idx_project_code_start_time(project_code,start_timeDESC,idDESC)idx_workflow_definition_code_start_time(workflow_definition_code,start_timeDESC)For
t_ds_task_instancetable:idx_project_code_submit_time(project_code,submit_timeDESC)idx_project_code_start_time(project_code,start_timeDESC)Verify this pull request
This pull request is code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(or)
Pull Request Notice
Pull Request Notice
If your pull request contains incompatible change, you should also add it to
docs/docs/en/guide/upgrade/incompatible.md