From c2d577479012c1207931ceb735e46cc51c4adc57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=B6=E5=90=8D?= <13774486042@163.com> Date: Sun, 5 Mar 2023 22:35:24 +0800 Subject: [PATCH] [Improvement] SQL optimization queryTheHighestPriorityTasks (#13671) Co-authored-by: chenjiaming --- .../dolphinscheduler/dao/mapper/TaskGroupQueueMapper.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskGroupQueueMapper.xml b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskGroupQueueMapper.xml index d2c43f18a7..a5bd80fbad 100644 --- a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskGroupQueueMapper.xml +++ b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskGroupQueueMapper.xml @@ -112,9 +112,9 @@ select from t_ds_task_group_queue - where priority = (select max(priority) from t_ds_task_group_queue where group_id = #{groupId} - and status = #{status} and in_queue = #{inQueue} and force_start = #{forceStart} ) and group_id = #{groupId} - and status = #{status} and in_queue = #{inQueue} and force_start = #{forceStart} limit 1 + where group_id = #{groupId} and status = #{status} and in_queue = #{inQueue} and force_start = #{forceStart} + order by priority desc + limit 1