3

What's the fastest java library that can be used to parse through large .sql dump files - that only contain insert commands - and execute all of them? Perhaps some kind of multi-threaded library?

1

To efficiently insert data into some MySQL database, the best solution is to use bulk inserts. The official MySQL Connector/J can do it. Benchmark:

InnoDB
Single inserts: 74148 ms
Batch insert: 84370 ms
Dirty bulk insert: 178 ms
Safe bulk insert: 118 ms

MyISAM
Single inserts: 604 ms
Batch insert: 447 ms
Dirty bulk insert: 63 ms
Safe bulk insert: 26 ms
  • "Why not hibernate or spring data?" - Perhaps because you didn't mention those as requirements ... – Stephen C Jan 2 '15 at 5:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.