O'Reilly logo
  • Bart Bialek thinks this is interesting:

if you need to update a number of records within a transaction, sort them by their primary key in the application’s memory, then update them in that order

From

Cover of High Performance MySQL, 3rd Edition

Note

Preventing dead locks