Any way to select without causing locking in MySQL?

后端 未结 8 1543
执笔经年
执笔经年 2020-11-22 15:21

Query:

SELECT COUNT(online.account_id) cnt from online;

But online table is also modified by an event, so frequently I can see lock by runn

8条回答
  •  有刺的猬
    2020-11-22 15:34

    SELECTs do not normally do any locking that you care about on InnoDB tables. The default transaction isolation level means that selects don't lock stuff.

    Of course contention still happens.

提交回复
热议问题