![]() |
叛逆的沙发 · Convert data ...· 1 月前 · |
![]() |
飞翔的打火机 · imageStore(3g) — ...· 1 月前 · |
![]() |
苦恼的伤痕 · imageStore - GLSL 4 - ...· 1 月前 · |
![]() |
阳刚的太阳 · openlayer开发报错记录:Uncaug ...· 1 月前 · |
![]() |
豪爽的热水瓶 · requests--传递参数 - ...· 1 周前 · |
![]() |
挂过科的生姜 · lists:keydelete/3 - ...· 4 月前 · |
![]() |
冷冷的上铺 · 爱上ASMR_www.asasmr3.com ...· 4 月前 · |
![]() |
傲视众生的啤酒 · NBA官网称姚明决定退役_CNTV新闻台_中 ...· 6 月前 · |
![]() |
光明磊落的卤蛋 · plotly.express.box — ...· 11 月前 · |
我正在使用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
![]() |
叛逆的沙发 · Convert data com.alibaba.excel.metadata.data.ReadCellData@35e792f8 to class java.util.Date error - 1 月前 |
![]() |
豪爽的热水瓶 · requests--传递参数 - 邹邹很busy。 1 周前 |