In mysql_update there are two cases for how to perform the update One reads all tuples first and then applies the updates. The second reads the tuples in a loop and applies the updates. The first is used for all updates where Order By is used AND for all updates that update index attributes. I can see two optimisations here. Order By without a limit constraint is useless and can thus be ignored. Order By with limit still needs to use the first case. Some handlers are ok with updating the indexes in parallel with the reading and those should also use the second loop. Probably a handler flag is needed for this. The same most likely applies for mysql_delete as well. multi_mysql_update and multi_mysql_delete have not been studied.