You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@linkis.apache.org by GitBox <gi...@apache.org> on 2022/04/11 07:31:04 UTC

[GitHub] [incubator-linkis] peacewong opened a new issue, #1935: [Feature] [JobHistory]Poor performance of the interface to view unfinished tasks

peacewong opened a new issue, #1935:
URL: https://github.com/apache/incubator-linkis/issues/1935

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-linkis/issues) and found no similar feature requirement.
   
   
   ### Problem Description
   
   The interface provided by Jobhistory to the front-end list to view unfinished tasks has poor performance. The interface is: /api/rest_j/v1/jobhistory/list?pageSize=100&status=Running,Inited,Scheduled. Because the interface query does not use the taskid index, a full table scan is caused.
   Jobhistory提供给前端list查看未完成任务的接口性能较差,接口为:/api/rest_j/v1/jobhistory/list?pageSize=100&status=Running,Inited,Scheduled。因为该接口查询没有利用到taskid索引,导致了全表扫描。
   ![企业微信截图_16496615417980](https://user-images.githubusercontent.com/11496700/162685396-f33924cc-5bb3-4ea7-9d7d-27f728bfe7ce.png)
   
   
   ### Description
   
   _No response_
   
   ### Use case
   
   _No response_
   
   ### solutions
   
   It is recommended to add the /api/rest_j/v1/jobhistory/listundone interface for querying unfinished tasks.
   1. Request method get
   2. Parameters:
   ```
   @RequestParam(value = "startDate", required = false) Long startDate,
   @RequestParam(value = "endDate", required = false) Long endDate,
   @RequestParam(value = "status", required = false) String status,
   @RequestParam(value = "pageNow", required = false) Integer pageNow,
   @RequestParam(value = "pageSize", required = false) Integer pageSize,
   @RequestParam(value = "startTaskID", required = false) Long taskID,
   @RequestParam(value = "ecType", required = false)String ecType,
   @RequestParam(value = "creator", required = false) String creator
   ```
   3. The return remains the same as the previous interface
   
   The main modification point is to use the scheduled task to query the smallest TaskID of the unfinished task once a day at 00:15, so that when calling listUndone, you can use the taskID indexing ability in the sql, by judging > greater than the smallest taskID.
   
   建议新增/api/rest_j/v1/jobhistory/listundone接口,用于查询未完成的任务。
   1. 请求方式 get
   2. 参数:
   ```
   @RequestParam(value = "startDate", required = false) Long startDate,
   @RequestParam(value = "endDate", required = false) Long endDate,
   @RequestParam(value = "status", required = false) String status,
   @RequestParam(value = "pageNow", required = false) Integer pageNow,
   @RequestParam(value = "pageSize", required = false) Integer pageSize,
   @RequestParam(value = "startTaskID", required = false) Long taskID,
   @RequestParam(value = "ecType", required = false)String ecType,
   @RequestParam(value = "creator", required = false) String creator
   ```
   3. 返回保持和之前接口一致
   
   主要修改点为,利用定时任务每天00:15查询一次未完成任务最小的TaskID,这样当调用listUndone时可以再sql里面利用taskID索引能力,通过判断 >大于最小的taskID即可
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!


-- 
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: dev-unsubscribe@linkis.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@linkis.apache.org
For additional commands, e-mail: dev-help@linkis.apache.org


[GitHub] [incubator-linkis] peacewong closed issue #1935: [Feature] [JobHistory]Poor performance of the interface to view unfinished tasks

Posted by GitBox <gi...@apache.org>.
peacewong closed issue #1935: [Feature] [JobHistory]Poor performance of the interface to view unfinished tasks
URL: https://github.com/apache/incubator-linkis/issues/1935


-- 
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: dev-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@linkis.apache.org
For additional commands, e-mail: dev-help@linkis.apache.org


[GitHub] [incubator-linkis] legendtkl commented on issue #1935: [Feature] [JobHistory]Poor performance of the interface to view unfinished tasks

Posted by GitBox <gi...@apache.org>.
legendtkl commented on issue #1935:
URL: https://github.com/apache/incubator-linkis/issues/1935#issuecomment-1094821698

   I will fix this


-- 
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: dev-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@linkis.apache.org
For additional commands, e-mail: dev-help@linkis.apache.org