0

I use PHP with Mysql. I care about performance and stability and that's why I now use multiple inserts / updates in one single SQL query (which is generated by PHP). With that I insert / update 1000 rows. It takes about 6 seconds.

Kind of like this but larger:

Inserting multiple rows in mysql

I've read about transactions which is meant to speed up where multiple SQL queries are added to a kind of buffer (I guess) and then all is executed.

Which method should I use in terms of performance and stability? Pros and cons?

Community
  • 1
  • 1
Jens Törnell
  • 23,180
  • 45
  • 124
  • 206
  • Not having transactions: Pros, higher concurrency; cons, lack of data integrity. Having trans: Pros, data integrity; cons, lower concurrency – Drew Oct 14 '16 at 06:52
  • @Drew Alright, what would you choose? – Jens Törnell Oct 14 '16 at 06:56
  • You're only as good as the quality of your data. What good is *performance* if you perform your data into the trash can. One aims to avoid deadlocks, lock, and resource starvation while also honoring higher priority tasks. To prevent or resolve the problem by breaking the symmetry of locks and this varies by implementation. – Drew Oct 14 '16 at 07:14

0 Answers0