开发者

UPDATE LOW_PRIORITY does it return the correct number of affected_rows?

开发者 https://www.devze.com 2023-03-10 09:34 出处:网络
I need to make a lot of UPDATE and I don\'t need to read the table often. So I thought of using UPDATE LOW_PRIORITY but does it return the correct number of affected_rows() ?

I need to make a lot of UPDATE and I don't need to read the table often.

So I thought of using UPDATE LOW_PRIORITY but does it return the correct number of affected_rows() ?

Or considering it's not instantly committed it can't know how many records will be affected?

mysql_q开发者_JS百科uery("UPDATE LOW_PRIORITY table SET view = view + 1 WHERE id = 123");
echo mysql_affected_rows();


Yes it returns the affected rows number, LOW_PRIORITY doesn't affect this part.

With the LOW_PRIORITY keyword, execution of the UPDATE is delayed until no other clients are reading from the table. This affects only storage engines that use only table-level locking (such as MyISAM, MEMORY, and MERGE).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号