 |
|
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
|

06-27-2014
, 09:59
Re: 3d Array saving (MySQL) [90 Queires?]
|
#10
|
The way I'm doing it is sending multiple rows with REPLACE INTO table VALUES (row1), (row2), (row3)...
Transactions aren't really necessary for this because you can simply insert/replace multiple rows with one query.
Also, there's hardly any need for an API IMO, as you can just send this via a threaded query:
START TRANSACTION; QUERY1; QUERY2; QUERY3; COMMIT
Which works, but the callback is called for each query anyways, so I'm not sure if there's any improvement in terms of performance. The adventage of transactions is not speed/performance/less queries, but the ability to roll back the entire transaction if something goes wrong.
Again, there's no need to reinvent the wheel, I already had to deal with the same problem which was a lot of queries and my solution is probably the best.
Last edited by Backstabnoob; 06-27-2014 at 10:09.
|
|
|
|