MySQL Forums
Forum List  »  InnoDB

Should ORDER BY SELECTs to to avoid deadlocks?
Posted by: Victor Porton
Date: September 30, 2016 12:52PM

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

Options: ReplyQuote


Subject
Views
Written By
Posted
Should ORDER BY SELECTs to to avoid deadlocks?
541
September 30, 2016 12:52PM


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.