Quantcast
Channel: MySQL Forums - InnoDB
Viewing all articles
Browse latest Browse all 1954

Should ORDER BY SELECTs to to avoid deadlocks? (3 replies)

$
0
0
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?

Viewing all articles
Browse latest Browse all 1954

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>