Any way to select without causing locking in MySQL?

后端 未结 8 1557
执笔经年
执笔经年 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:23

    Use

    SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED.

    Version 5.0 Docs are here.

    Version 5.1 Docs are here.

提交回复
热议问题