I want to do them in a multi insert transaction block for speed so that the indexes are only updated once after all inserts.Eh, this is the first time I hear that MySQL only updates indices on a commit.
Forget about indices and transactions. You're problem is doing 100000 queries. 100000 times the latency between your application and the database.for 1...100000 { $insert_sth->execute($_); }
Want speed? Write a single statement* and execute that.
*If you would insert millions of integers, your query becomes larger than the max package size. Either increase that, or create a handful of statements, each slightly smaller than the max package size.
In reply to Re: correct way to do multi-insert/update transaction
by JavaFan
in thread correct way to do multi-insert/update transaction
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |