解决mybatisPlus批量插入saveBatch(list)慢的方法
saveBatch方法作用和改进
·
当我们批量插入数据的时候,调用saveBatch方法,通过打印日志,可以知道它是用了循环插入,也就是数据一个一个的插入,会让效率稍慢,我们可以开启数据库批量提交&rewriteBatchedStatements=true来加快效率。
url: jdbc:mysql://127.0.0.1:3306/order?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
更多推荐
已为社区贡献3条内容
所有评论(0)