ghwillbe opened a new issue, #18700: URL: https://github.com/apache/dolphinscheduler/issues/18700
### Search before asking - [x] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description 1. The API time out as below: ` http://xx.xx.xx.xx:12345/dolphinscheduler/projects/xxx/task-instances?pageSize=10&pageNo=1&searchVal=&taskCode=&workflowInstanceId=&host=&stateType=&startDate=&endDate=&executorName=&workflowInstanceName=` 2. When the number of task instances exceeds a certain threshold, data loading times out (after 10 seconds) upon accessing the task instance page. the SQL of time out I found: `SELECT COUNT(*) FROM t_ds_task_instance WHERE project_code = xxx AND task_execute_type = 0;` I added an index for table t_ds_task_instance: `ALTER TABLE dolphinscheduler.t_ds_task_instance ADD INDEX idx_project_type_submit_time (project_code, task_execute_type, submit_time DESC), ALGORITHM=INPLACE, LOCK=NONE;` time out issue fixed. 3. When I continue to search Task Instance data with task instance name or workflow instance name, The timeout issue has cropped up again. The flowing API request URL for your reference. `http://xx.xx.xx.xx:12345/dolphinscheduler/projects/xxx/task-instances?pageSize=10&pageNo=1&searchVal=&taskCode=&workflowInstanceId=&host=&stateType=&startDate=&endDate=&executorName=&workflowInstanceName=xxworkflow ` `http://xx.xx.xx.xx:12345/dolphinscheduler/projects/xxx/task-instances?pageSize=10&pageNo=1&searchVal=xxtaskinstance&taskCode=&workflowInstanceId=&host=&stateType=&startDate=&endDate=&executorName=&workflowInstanceName=` ### Are you willing to submit a PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
