未验证 提交 6dd0e050 编写于 作者: W wind 提交者: GitHub

[DS-6433][Improvement] find one command optimize without mybatis-plus (#6434)

Co-authored-by: Ncaishunfeng <534328519@qq.com>
上级 1621d0a5
......@@ -56,6 +56,6 @@ public interface CommandMapper extends BaseMapper<Command> {
* query command page
* @return
*/
IPage<Command> queryCommandPage(IPage<Command> page);
List<Command> queryCommandPage(@Param("limit") int limit, @Param("offset") int offset);
}
......@@ -46,6 +46,7 @@
<select id="queryCommandPage" resultType="org.apache.dolphinscheduler.dao.entity.Command">
select *
from t_ds_command
order by update_time asc
order by process_instance_priority, id asc
limit #{limit} offset #{offset}
</select>
</mapper>
......@@ -308,8 +308,7 @@ public class ProcessService {
* @return
*/
public List<Command> findCommandPage(int pageSize, int pageNumber) {
Page<Command> commandPage = new Page<>(pageNumber, pageSize);
return commandMapper.queryCommandPage(commandPage).getRecords();
return commandMapper.queryCommandPage(pageSize, pageNumber * pageSize);
}
/**
......
......@@ -327,7 +327,8 @@ CREATE TABLE t_ds_command
process_instance_priority int(11) DEFAULT NULL,
worker_group varchar(64),
environment_code bigint(20) DEFAULT '-1',
PRIMARY KEY (id)
PRIMARY KEY (id),
KEY priority_id_index (process_instance_priority, id)
);
-- ----------------------------
......
......@@ -333,7 +333,8 @@ CREATE TABLE `t_ds_command` (
`worker_group` varchar(64) COMMENT 'worker group',
`environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code',
`dry_run` int NULL DEFAULT 0 COMMENT 'dry run flag:0 normal, 1 dry run',
PRIMARY KEY (`id`)
PRIMARY KEY (`id`),
KEY `priority_id_index` (`process_instance_priority`,`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
......
......@@ -258,6 +258,8 @@ CREATE TABLE t_ds_command (
PRIMARY KEY (id)
) ;
create index priority_id_index on t_ds_command (process_instance_priority,id);
--
-- Table structure for table t_ds_datasource
--
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册