]> source.dussan.org Git - sonarqube.git/commitdiff
rewrite PropertiesMapper.findNotificationSubscribers without subselect
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Fri, 2 Sep 2016 12:34:33 +0000 (14:34 +0200)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Fri, 9 Sep 2016 07:11:42 +0000 (09:11 +0200)
sonar-db/src/main/resources/org/sonar/db/property/PropertiesMapper.xml

index e3bae5b1baa37375b41e2f934ee7dc0852347d7e..eb6a14664f1698717cdeade7a426ee0f281de776 100644 (file)
     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}
+      <if test="componentKey != null">
+        left outer join projects p1 on p.resource_id=p1.id and p1.kee=#{componentKey}
+      </if>
+    where
+      p.prop_key = #{propKey}
       and p.text_value like 'true'
       and (
         p.resource_id is null
         <if test="componentKey != null">
-          or p.resource_id in (select id from projects where kee=#{componentKey})
+          or p.resource_id=p1.id
         </if>
       )
   </select>