Raised This Month: $ Target: $400
 0% 

3d Array saving (MySQL) [90 Queires?]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-27-2014 , 09:59   Re: 3d Array saving (MySQL) [90 Queires?]
Reply With Quote #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.
Backstabnoob is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:51.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode