美文网首页
MySQL之rewriteBatchedStatements

MySQL之rewriteBatchedStatements

作者: 抄无止境 | 来源:发表于2020-11-27 10:06 被阅读0次

最近尝试使用MySql,建了一个表40列,每次通过Entity List的方式写入1000条数据。saveBatch(list);

通过StopWatch一查看,区区1000行数据竟然用时10S,简直不能忍。
开始以为是MybatisPlus的问题,查看了源码,人家的确是批量写入的,没啥毛病。
一番搜索,网友给出了如下方案
数据库连接参数配置了 rewriteBatchedStatements=true 最终得以解决!

master.jdbc.url=jdbc:mysql://xxx.xx.xxx.xx:3306/outreach_platform?useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&rewriteBatchedStatements=true

感谢
MySQL之rewriteBatchedStatements
我在Mybatis-plus提升批量插入性能20倍

相关文章

网友评论

      本文标题:MySQL之rewriteBatchedStatements

      本文链接:https://www.haomeiwen.com/subject/fhatwktx.html