Tag

rewriteBatchedStatements

1 views collected around this technical thread.

Zhuanzhuan Tech
Zhuanzhuan Tech
Nov 28, 2024 · Backend Development

Boosting MyBatis-Plus Batch Insert Performance by 2000% with rewriteBatchedStatements and Pre‑Generated IDs

This article explains how to dramatically improve MyBatis-Plus batch insertion speed—up to 2000%—by enabling rewriteBatchedStatements, pre‑generating primary keys to handle foreign‑key relationships, applying proper JDBC batch settings, and using asynchronous multithreaded insertion with optimized connection‑pool and executor configurations.

ID GenerationJDBCMyBatis-Plus
0 likes · 21 min read
Boosting MyBatis-Plus Batch Insert Performance by 2000% with rewriteBatchedStatements and Pre‑Generated IDs
macrozheng
macrozheng
Nov 23, 2023 · Backend Development

Why MyBatis‑Plus saveBatch Is Slow and How to Fix It with JDBC rewriteBatchedStatements

This article explains why using MyBatis‑Plus saveBatch for bulk inserts can cause 5‑6 second delays, analyzes the underlying per‑row INSERT behavior, and shows how adding rewriteBatchedStatements=true to the JDBC URL dramatically reduces execution time to a few hundred milliseconds.

JDBCMyBatis-PlusPerformance
0 likes · 7 min read
Why MyBatis‑Plus saveBatch Is Slow and How to Fix It with JDBC rewriteBatchedStatements