且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MySQL多删除。是否有可能多删除引用的行?

更新时间:2023-02-02 22:50:31

I solve the problem with optimizer hints, by specifying the exact join order in the DELETE command:

delete a, b
from b
STRAIGHT_JOIN a on a.id = b.a_id
where a.id = ?;

MySQL will DELETE b rows first thanks to the optimizer hint STRAIGHT_JOIN.

相关阅读

技术问答最新文章