]> source.dussan.org Git - sonarqube.git/commitdiff
Optimize insert in table RESOURCE_INDEX
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 5 Jul 2016 20:40:14 +0000 (22:40 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 6 Jul 2016 13:44:31 +0000 (15:44 +0200)
by specifying the JDBC types of columns in MyBatis mapper.

sonar-db/src/main/resources/org/sonar/db/component/ResourceIndexMapper.xml

index bfd4a31557332ea3dfb8377e5afdb437a3a3904e..94bb6588d7370798b0f680fe166788121b19ed91 100644 (file)
   </delete>
 
   <insert id="insert" parameterType="ResourceIndex" useGeneratedKeys="false">
-    insert into resource_index (kee, position, name_size, component_uuid, root_component_uuid, qualifier)
-    values (#{key}, #{position}, #{nameSize},
-    #{componentUuid}, #{rootComponentUuid}, #{qualifier})
+    insert into resource_index (
+    kee,
+    position,
+    name_size,
+    component_uuid,
+    root_component_uuid,
+    qualifier)
+    values (
+    #{key, jdbcType=VARCHAR},
+    #{position, jdbcType=INTEGER},
+    #{nameSize, jdbcType=INTEGER},
+    #{componentUuid, jdbcType=VARCHAR},
+    #{rootComponentUuid, jdbcType=VARCHAR},
+    #{qualifier, jdbcType=VARCHAR}
+    )
   </insert>
 
 </mapper>