]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8089 Remove useless join on snapshots in ComponentMapper#selectDescendants... 1342/head
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Thu, 27 Oct 2016 16:42:59 +0000 (18:42 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Fri, 28 Oct 2016 12:53:26 +0000 (14:53 +0200)
sonar-db/src/main/resources/org/sonar/db/component/ComponentMapper.xml

index 383175c492e25635b54709736954d80122866ad3..52dd7c8820631ef15a25f4b13d62e02f446bb335 100644 (file)
 
   <sql id="sqlChildren">
     from projects p
-    inner join projects base on base.project_uuid = p.project_uuid
-    inner join snapshots s on s.component_uuid = base.project_uuid
+    inner join projects base on base.project_uuid = p.project_uuid and base.uuid = #{query.baseUuid}
     where
-    base.uuid = #{query.baseUuid}
-    and p.enabled = ${_true}
-    and s.islast = ${_true}
+    p.enabled = ${_true}
     and p.uuid_path = #{baseUuidPath}
     <include refid="sqlTreeFilters"/>
   </sql>
 
   <sql id="sqlDescendants">
     from projects p
-    inner join projects base on base.project_uuid=p.project_uuid
-    inner join snapshots s on s.component_uuid = base.project_uuid
+    inner join projects base on base.project_uuid=p.project_uuid and base.uuid = #{query.baseUuid}
     where
-    base.uuid = #{query.baseUuid}
-    and p.enabled = ${_true}
+    p.enabled = ${_true}
     and p.uuid_path like #{baseUuidPathLike} ESCAPE '/'
-    and s.islast = ${_true}
     <include refid="sqlTreeFilters"/>
   </sql>