MySQL Forums :: InnoDB :: Should ORDER BY SELECTs to to avoid deadlocks?


Advanced Search

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? 469 Victor Porton 09/30/2016 12:52PM
Re: Should ORDER BY SELECTs to to avoid deadlocks? 309 Rick James 10/02/2016 12:33PM
Re: Should ORDER BY SELECTs to to avoid deadlocks? 263 Victor Porton 10/02/2016 12:46PM
Re: Should ORDER BY SELECTs to to avoid deadlocks? 263 Rick James 10/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.