ASi

select count() 中の insert

count(field) でも count(*) でも、 for update でロックすると、insert はブロックされる。
逆の insert のトランザクション中も select count() はブロックされる。

関連
https://ashura156.hatenablog.com/entry/2020/05/13/130916