Should ORDER BY SELECTs to to avoid deadlocks?
I start a transaction.
I read some rows with SELECTs.
Then I do modifications (UPDATE/INSERT/DELETE) related with these rows which I've read.
I commit.
MySQL docs say that it is better to have statements running in the same order to avoid deadlocks. So my question: Should I add ORDER BY to my SELECTs in order to be sure they are always run in the same order, to avoid deadlocks?
--
http://freesoft.portonvictor.org
Subject
Views
Written By
Posted
Should ORDER BY SELECTs to to avoid deadlocks?
1457
September 30, 2016 12:52PM
962
October 02, 2016 12:33PM
792
October 02, 2016 12:46PM
761
October 03, 2016 10:59PM
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.