简体   繁体   中英

mysql sequential updates or simultaneous updates

I would like to ask, whether it is more optimum to perform a simultaneous update in 3 mysql tables using a joined query or perform each in turn sequentially? Thanks Any help is greatly appreciated.

EV

From a purely performance point of view the less connection you made to the database, the better, if the total execution time of the joined query is not bigger that the sum of time for the 3 query, which should be the case.

So, without more informations, I'll say the joined query will performs better.

But I think the best answer is " Try it ". Write some code to run a thousand time each query and then do a comparison of the times.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM