MySQL InnoDB – Do Uncommitted Transactions Produce Redo Logs?

innodbMySQLrecoverytransaction-log

Before MySQL commit a transaction, it will write REDO log first, then commit the transaction, that is write ahead log.

start transaction;

update users set uuid = UUID() from user where id = 1
update users set uuid = UUID() from user where id = 2
update users set uuid = UUID() from user where id = 3
...
...
update users set uuid = UUID() from user where id = 1,000,000
// not yet commit

If a transaction is going to update 1 million records, which takes 100 seconds. During the period of execution, will this uncommitted transaction produce redo log?

Best Answer

innodb produce redo log during transaction and may sync to disk even if the transaction has not committed.