@Root1223 在 分享一个关于springboot中pgsql配置文件参数 中发帖
偶然在优化插入sql的时候发现的参数,之前都不知道,感觉应该有部分佬友和我一样,因此分享一下。
reWriteBatchedInserts=true
spring:
datasource:
url: jdbc:postgresql://localhost:5432/postgres?reWriteBatchedInserts=true
username: postgres
password: 123456
此参数可以提升批量插入的性能。原理是将多个insert语句通过重写成一个insert语句,再进行插入。