diff options
author | Jacek Poreda <jacek.poreda@sonarsource.com> | 2023-03-16 16:27:56 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-03-20 20:02:58 +0000 |
commit | 6e43a98176f4f231f306dbbd19077bf3cda7d1b9 (patch) | |
tree | 01fc4301fdcdb6a3f6cd8b1eb91601ea91271abd | |
parent | 3858bedeb66f213e01e9a39165e6c384d9913049 (diff) | |
download | sonarqube-6e43a98176f4f231f306dbbd19077bf3cda7d1b9.tar.gz sonarqube-6e43a98176f4f231f306dbbd19077bf3cda7d1b9.zip |
SONAR-18729 Optimize ce_queue peek query by changing 'not exists' to 'left join' with condition
-rw-r--r-- | server/sonar-db-dao/src/main/resources/org/sonar/db/ce/CeQueueMapper.xml | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/ce/CeQueueMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/ce/CeQueueMapper.xml index 9aebba149fb..0e33cabba68 100644 --- a/server/sonar-db-dao/src/main/resources/org/sonar/db/ce/CeQueueMapper.xml +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/ce/CeQueueMapper.xml @@ -182,21 +182,14 @@ <if test="excludeViewRefresh"> left join components c on c.uuid = cq.main_component_uuid and c.qualifier <> 'VW' </if> + left join ce_queue cq2 on cq.main_component_uuid=cq2.main_component_uuid and cq2.status <>'PENDING' where cq.status='PENDING' and cq.started_at is null + and cq2.uuid is null <if test="excludeIndexationJob"> and cq.task_type <> 'ISSUE_SYNC' </if> - and not exists ( - select - 1 - from - ce_queue cq2 - where - cq.main_component_uuid=cq2.main_component_uuid - and cq2.status <> 'PENDING' - ) </sql> <sql id="orderBySelectEligibleForPeek"> |