MySQL Forums
Forum List  »  General

Re: Is it best practice to lock table for every Mysql query?
Posted by: Craig Liu
Date: December 27, 2018 11:01PM

Thank peter very much.

One more question: in mariadb 5.5 myisam, will MySQL server automatically add a suitable lock to a query? No manual lock needed. I.e. following query is the same:

SELECT * FROM t1 LEFT JOIN (t2 CROSS JOIN t3 CROSS JOIN t4) ON (t2.a = t1.a AND t3.b = t1.b AND t4.c = t1.c)

And

lock tables t1,t2,t3,t4 READ;
SELECT * FROM t1 LEFT JOIN (t2 CROSS JOIN t3 CROSS JOIN t4) ON (t2.a = t1.a AND t3.b = t1.b AND t4.c = t1.c);
unlock tables;

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.