Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用jdbcTemplate BatchUpdate批量插入效率慢的问题 #103

Open
lizhongzhen11 opened this issue Feb 23, 2021 · 0 comments
Open

使用jdbcTemplate BatchUpdate批量插入效率慢的问题 #103

lizhongzhen11 opened this issue Feb 23, 2021 · 0 comments

Comments

@lizhongzhen11
Copy link
Owner

https://blog.csdn.net/u012280292/article/details/85683854

不怎么会java,但是要把30M左右的文件解析后在数据库新建对应的表并把数据插入进去,我就用了最low的jdbcTemplate,后来用了 jdbcTemplate.batchUpdate 批量插入,但是还是很慢,18分钟左右,真的慢死了,刚刚想着如何优化,才知道jdbc连接mysql时加个 rewriteBatchedStatements=true 就行了,试了下,几秒钟搞定,真牛逼!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant