mysql SQL更新执行过程

WAL: Write-Ahead Logging 先写日志,再写磁盘

 redo log 是InnoDB所特有的,

update test set c=c+1 where ID=4;

 将redo log 写入拆成了两个步骤,prepare 和commitly这就是两阶段提交

innodb_flush_log_at_trx_commit=1 --每次事务的 redo log 都直接持久化到磁盘

sync_binlog=1           --每次事务的 binlog 都持久化到磁盘

原文地址:https://www.cnblogs.com/tingxin/p/14167580.html