1

If I run ten update queries like this, at the exact same time:

update table set x = x - 1 where x >= 1 

Does MySQL, under repeatable-read mode, guarantee that all these update queries are run one at a time, as opposed to in parallel (all at the same time)?

P.S: Does the where clause have any impact on whether it is run in a parallel or sequential style?

Oo Dee
  • 145
  • 1
  • 11
  • With repeatable-read mode you mean a translation set to REPEATABLE-READ.. see http://dev.mysql.com/doc/refman/5.7/en/set-transaction.html??? – Raymond Nijland Jan 12 '17 at 16:02
  • No a WHERE statement only filters out the records that needs to be updated. Does not have any impact if you query will run parallel or not – Raymond Nijland Jan 12 '17 at 16:03
  • What locking is used on read should have no impact on an UPDATE query. Reading is not the same as updating or inserting. It could effect how other queries which are reading perform, but if all your queries are updates it will not impact the results. – Hogan Jan 12 '17 at 17:32

1 Answers1

1

It will be sequential, Table/records will be locked until a given update is complete - Please read below

For storage engines such as MyISAM that actually execute table-level locks when executing DML or DDL statements, such a statement in older versions of MySQL (5.6.5 and earlier)that affected a partitioned table imposed a lock on the table as a whole; that is, all partitions were locked until the statement was finished

More details here - Partition and locking in mysql

Srikanth Balaji
  • 2,638
  • 4
  • 18
  • 31