Mysql+Mybatis插入批处理速率
1.mysql一分钟可以插入多少条记录 2.如果与mybatis合作,费率是多少 配置为:Mysql+Mybatis插入批处理速率,mysql,insert,batch-processing,mybatis,Mysql,Insert,Batch Processing,Mybatis,1.mysql一分钟可以插入多少条记录 2.如果与mybatis合作,费率是多少 配置为: <insert id="insertBatch" > insert into table(id, task_id, coupon_id, user_id, expire_time, create_time, update_time, is_deleted) values <foreach collection="list" item="item" index
<insert id="insertBatch" >
insert into table(id, task_id, coupon_id,
user_id, expire_time, create_time,
update_time, is_deleted) values
<foreach collection="list" item="item" index="index" separator="," >
(#{item.id,jdbcType=INTEGER}, #{item.taskId,jdbcType=INTEGER}, #{item.couponId,jdbcType=INTEGER},
#{item.userId,jdbcType=INTEGER}, #{item.expireTime,jdbcType=TIMESTAMP}, #{item.createTime,jdbcType=TIMESTAMP},
#{item.updateTime,jdbcType=TIMESTAMP}, #{item.isDeleted,jdbcType=TINYINT})
</foreach>
</insert>
3.如何提高插入的效率?一般来说,您应该使用准备好的语句。如果要插入innodb,事务将有所帮助。插入速度取决于硬件。请参阅并确保通过mybatis batch executor使用批插入