]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-12659 Improve Quality Profiles Query Performance
authorBelen Pruvost <belen.pruvost@sonarsource.com>
Mon, 30 Nov 2020 13:08:57 +0000 (13:08 +0000)
committersonartech <sonartech@sonarsource.com>
Wed, 2 Dec 2020 20:06:58 +0000 (20:06 +0000)
server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/QualityProfileMapper.xml

index 31c61544ed1ba01fea7025942ffe1dec44de4b51..e6dabc0aa382e909ed2929ab941f414f71359d53 100644 (file)
 
   <select id="countProjectsByProfiles" resultType="KeyLongValue" parameterType="map">
     select pqp.profile_key as "key", count(pj.uuid) as "value"
-    from components pj
+    from projects pj
     inner join project_qprofiles pqp on pqp.project_uuid = pj.uuid
     inner join org_qprofiles oqp on oqp.uuid = pqp.profile_key
     where
-      pj.enabled = ${_true}
+      pj.qualifier = 'TRK'
       and <foreach collection="profileUuids" item="profileUuid" open="(" separator=" or " close=")">
         oqp.uuid = #{profileUuid, jdbcType=VARCHAR}
       </foreach>