mybatis 批量插入 加快速度

2022-10-17  本文已影响0人  指下光年

mysql链接后加 rewriteBatchedStatements=true

spring:
  application:
    name: template-service
  datasource:
    name: template
    url: jdbc:mysql://172.16.20.107:3306/pressure_test?Unicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&rewriteBatchedStatements=true
    username: root
    password: 123456
    type: com.zaxxer.hikari.HikariDataSource
    driver-class-name: com.mysql.cj.jdbc.Driver
    hikari:
      minimum-idle: 8
      maximum-pool-size: 20
      auto-commit: true
      idle-timeout: 30000
      pool-name: AbupHikariCP
      max-lifetime: 1800000
      connection-timeout: 30000
      connection-test-query: SELECT 1
上一篇下一篇

猜你喜欢

热点阅读