MySQL Forums
Forum List  »  Performance

Re: Slow Performance with Multi-threaded app
Posted by: Rick James
Date: September 13, 2014 09:47AM

> Each thread has its own prepared statement in batch mode with commit interval of 100 records.

What are the details under the covers?

Plan A (bad):
BEGIN;
slowly gather 100 rows and insert them
COMMIT;

Plan B (good):
Slowly gather 100 rows
BEGIN;
One INSERT statement with all 100 rows
COMMIT;

If you cannot get the details from the Java documentation, turn on MySQL's "general log" to see what commands are being issued, and now far apart the statements are.

Options: ReplyQuote


Subject
Views
Written By
Posted
1763
September 12, 2014 09:24AM
Re: Slow Performance with Multi-threaded app
825
September 13, 2014 09:47AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.