用mybatis批量插入近200条的数据大概用时5s!!这个速度太可怕了
百度找了很多方案,如并发插入多个线程同时操作,但效果仍不是很明显,并且资源开销大。
最终解决方案是
数据库连接参数配置了 rewriteBatchedStatements=true 最终得以解决!
经过测试速度达到了毫秒级别,
100000条数据的情况下也控制在20s以下!