使用 left join 更新是否会锁定所有 MyIsam 表 mysql?
我正在 mysql 中进行表更新,包括其他表上的 2 个左连接。这是所有 MyIsam 表。
更新
DB
.tutorial_code
LEFT JOINtutorial
ONtutorial
.id_tutorial
=tutorial_code
.ref_tutorial
LEFT JOINtutorial_code_language
ONtutorial_code_language
.id_tutorial_code_language
='1' SETtutorial_code
= '要添加的代码',ref_tutorial_code_language
= '2' WHEREtutorial_code
.id_tutorial_code
='3' ANDtutorial
.ref_tutorial_main
='1' ANDtutorial_code_language
.id_tutorial_code_language
='1'
我想知道是否只有更新的表才会在此过程中被锁定,或者是否在该过程中总共 3 个表(更新的表和两个连接的表)将被锁定。事实上,我不希望在此过程中修改连接表,因为更新取决于它们。
如果 2 个连接表没有锁定,我想我将不得不使用 lock 和 lock write 每个使用的表
I am doing a table update in mysql including 2 left join on other tables. This is all MyIsam tables.
UPDATE
DB
.tutorial_code
LEFT JOINtutorial
ONtutorial
.id_tutorial
=tutorial_code
.ref_tutorial
LEFT JOINtutorial_code_language
ONtutorial_code_language
.id_tutorial_code_language
='1' SETtutorial_code
= 'code to be added',ref_tutorial_code_language
= '2' WHEREtutorial_code
.id_tutorial_code
='3' ANDtutorial
.ref_tutorial_main
='1' ANDtutorial_code_language
.id_tutorial_code_language
='1'
I am wondering if only the table updated will be locked during the process or if the total of the 3 tables (the update one and the two joined ones) will be locked during the process. Indeed I don't want the joined tables to be modified during the process as the update depends on them.
If the 2 joined tables are not locked, I guess that I will have to use lock and lock write every tables used
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
他们都会锁定。
They will all lock.