![]() |
没读研的酸菜鱼 · R语言数据的导入与导出 - ...· 3 月前 · |
![]() |
纯真的冲锋衣 · 数据争用(data race) ...· 2 月前 · |
![]() |
温暖的弓箭 · 11_vue计算属性computed_vue ...· 2 月前 · |
![]() |
彷徨的充电器 · computed, watch, ...· 2 月前 · |
![]() |
年轻有为的楼房 · 为select标签绑定onchange事件_ ...· 2 月前 · |
![]() |
豪情万千的回锅肉 · 三分钟了解 Python3 的异步 Web ...· 7 月前 · |
![]() |
年轻有为的猴子 · TensorRT7.0版本在Linux环境安 ...· 1 年前 · |
![]() |
刚分手的哑铃 · 【实用】3种调整matplotlib图片大小 ...· 1 年前 · |
![]() |
霸气的拐杖 · Bookle 搜索 - ...· 1 年前 · |
![]() |
安静的火柴 · Unity3D打包WebGL运行导出H5报错 ...· 1 年前 · |
我正在使用spring data saveAll在Oracle数据库中保存3500条记录,但是执行速度非常慢,有没有办法进行批量插入或其他更快的方法?
noteRepository.saveAll(noteEntityList);//<- this one is slow for 3000 records
提前感谢
发布于 2021-04-20 01:25:46
默认情况下,saveAll不会创建批处理,需要开启批处理。您需要设置以下属性才能启用批处理
spring.jpa.properties.hibernate.jdbc.batch_size=100
spring.jpa.properties.hibernate.order_inserts=true (if inserts)
spring.jpa.properties.hibernate.order_updates=true (if updates)
第一个属性批量收集事务,第二个属性收集按实体分组的语句。
有关更多详细信息,请查看此帖子 How to do bulk (multi row) inserts with JpaRepository?
https://stackoverflow.com/questions/67165998
复制相似问题
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2024 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号: 粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287