diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-01-26 14:51:49 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-01-26 14:51:49 +0100 |
commit | f0de650b264f08c766ef992e295b33ed6ab4e4d4 (patch) | |
tree | ee2204e6cf48a58c59c079deecdf7bc42aa651b1 /sonar-core | |
parent | b35fa4fa335abfd86ee721369e344cb7876c23fe (diff) | |
download | sonarqube-f0de650b264f08c766ef992e295b33ed6ab4e4d4.tar.gz sonarqube-f0de650b264f08c766ef992e295b33ed6ab4e4d4.zip |
SONAR-6063 Performance issue when loading Project Referentials with MS SQL
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/resources/org/sonar/core/component/db/SnapshotMapper.xml | 4 | ||||
-rw-r--r-- | sonar-core/src/main/resources/org/sonar/core/properties/PropertiesMapper.xml | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/sonar-core/src/main/resources/org/sonar/core/component/db/SnapshotMapper.xml b/sonar-core/src/main/resources/org/sonar/core/component/db/SnapshotMapper.xml index 0aeb697a2c3..06f63965cd9 100644 --- a/sonar-core/src/main/resources/org/sonar/core/component/db/SnapshotMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/component/db/SnapshotMapper.xml @@ -73,10 +73,10 @@ </select> <sql id="selectChildrenModulesFromModuleQuery"> - SELECT <include refid="org.sonar.core.component.db.SnapshotMapper.snapshotColumns"/> + SELECT s.project_id as resourceId, s.parent_snapshot_id as parentId FROM snapshots s INNER JOIN snapshots root_snapshot ON root_snapshot.id = s.root_snapshot_id AND root_snapshot.islast = ${_true} - INNER JOIN snapshots current_snapshot ON current_snapshot.root_project_id = root_snapshot.project_id AND s.islast = ${_true} + INNER JOIN snapshots current_snapshot ON current_snapshot.root_project_id = root_snapshot.project_id AND current_snapshot.islast = ${_true} INNER JOIN projects module ON module.id = current_snapshot.project_id AND module.enabled = ${_true} AND module.kee = #{moduleKey} <where> AND s.islast = ${_true} diff --git a/sonar-core/src/main/resources/org/sonar/core/properties/PropertiesMapper.xml b/sonar-core/src/main/resources/org/sonar/core/properties/PropertiesMapper.xml index d86d22e817c..95829b70871 100644 --- a/sonar-core/src/main/resources/org/sonar/core/properties/PropertiesMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/properties/PropertiesMapper.xml @@ -49,7 +49,6 @@ SELECT prop.id as id, prop.prop_key as "key", prop.text_value as value, prop.resource_id as resourceId, prop.user_id as userId FROM properties prop INNER JOIN (<include refid="org.sonar.core.component.db.SnapshotMapper.selectChildrenModulesFromModuleQuery" />) snapshotModules on snapshotModules.resourceId=prop.resource_id - INNER JOIN projects p on p.id = prop.resource_id WHERE prop.user_id IS NULL </select> |