From: Sébastien Lesaint Date: Fri, 2 Sep 2016 12:34:33 +0000 (+0200) Subject: rewrite PropertiesMapper.findNotificationSubscribers without subselect X-Git-Tag: 6.1-RC1~168 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5f5f6216ac5aca1aad4d60ecc947dd2275c453f2;p=sonarqube.git rewrite PropertiesMapper.findNotificationSubscribers without subselect --- 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 )