I'd like to know from where-to where the UPDATE start and finish. Always from the lowest key to the high one? Or could update row in t开发者_运维百科he middle before update the first ones?
It's usually some unknown function of the WHERE
clause in the UPDATE
but nothing is guaranteed, so don't count on anything, however...
You can add a order by clause to your update statement, like so:
UPDATE mytable SET mytable.myfield = mytable.id + 1 ORDER BY id;
Then the update
statement will run from the lowest to the highest id.
it is undefined. the entire transaction will be read consistent from the first update to the first commit.
精彩评论