savebatch 数据库配置
时间: 2023-09-14 11:11:15 浏览: 161
要提高MySQL数据库的saveBatch批量插入效率,可以通过配置数据库连接URL来实现。具体方法如下:
在数据库连接URL中添加rewriteBatchedStatements=true属性,即可启用批量操作。例如:jdbc:mysql://数据库地址/数据库名?useUnicode=true&characterEncoding=UTF8&allowMultiQueries=true&rewriteBatchedStatements=true。这样配置后,MybatisPlus的saveBatch方法也会采用SQL拼接方式重写,从而提高效率。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [MyBatis-Plus的saveBatch批量插入为何效率很低耗时长详解及解决方案](https://blog.csdn.net/qq_40093255/article/details/125796564)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [优化MybatisPlus的saveBatch方法](https://blog.csdn.net/m0_65014849/article/details/130677342)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文