Re: Slow Concurrent Updates
Hi Felix,
Using RAND() to avoid locking issues is not a good idea. It may work when there are a lot of null request_guid rows but when those start to run low you will hit the locking issues again for sure.
You should use some locking mechanism in the row you want to update. Use transactions, locking reads or whatever. (https://dev.mysql.com/doc/refman/5.7/en/innodb-locking-reads.html)
As for an efficient way of choosing a random row this article may help you:
http://jan.kneschke.de/projects/mysql/order-by-rand/.
IHTH
Subject
Written By
Posted
Re: Slow Concurrent Updates
July 31, 2017 10:36AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.