From 808661b7a9c38770e02d2037062ca7fede475715 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Thu, 27 Oct 2016 18:42:59 +0200 Subject: [PATCH] SONAR-8089 Remove useless join on snapshots in ComponentMapper#selectDescendants and selectChildren --- .../org/sonar/db/component/ComponentMapper.xml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/sonar-db/src/main/resources/org/sonar/db/component/ComponentMapper.xml b/sonar-db/src/main/resources/org/sonar/db/component/ComponentMapper.xml index 383175c492e..52dd7c88206 100644 --- a/sonar-db/src/main/resources/org/sonar/db/component/ComponentMapper.xml +++ b/sonar-db/src/main/resources/org/sonar/db/component/ComponentMapper.xml @@ -346,12 +346,9 @@ 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} @@ -397,13 +394,10 @@ 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} -- 2.39.5