From 5f5f6216ac5aca1aad4d60ecc947dd2275c453f2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Lesaint?= Date: Fri, 2 Sep 2016 14:34:33 +0200 Subject: [PATCH] rewrite PropertiesMapper.findNotificationSubscribers without subselect --- .../org/sonar/db/property/PropertiesMapper.xml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sonar-db/src/main/resources/org/sonar/db/property/PropertiesMapper.xml b/sonar-db/src/main/resources/org/sonar/db/property/PropertiesMapper.xml index e3bae5b1baa..eb6a14664f1 100644 --- a/sonar-db/src/main/resources/org/sonar/db/property/PropertiesMapper.xml +++ b/sonar-db/src/main/resources/org/sonar/db/property/PropertiesMapper.xml @@ -33,16 +33,19 @@ select u.login from - properties p, - users u - where + properties p + inner join users u on p.user_id = u.id - and p.prop_key = #{propKey} + + left outer join projects p1 on p.resource_id=p1.id and p1.kee=#{componentKey} + + where + p.prop_key = #{propKey} and p.text_value like 'true' and ( p.resource_id is null - or p.resource_id in (select id from projects where kee=#{componentKey}) + or p.resource_id=p1.id ) -- 2.39.5