mysql update statement is how to implement it

 

 

1, the actuator to find the data needs to be updated through the engine

2, the data has been returned directly in memory, or read from disk into memory

3, in the data update performed

4, the new engine will write data to memory, but the transaction is written to redo log prepare state.

5, engine informed actuators, execution is completed. The actuator will bin log of this operation is written to disk

6, the implementation of the interface calls to commit the transaction, the transaction is committed.
Involved in the process and the redo log bin log

redo log records the latest data cache. mysql update not update a data directly to disk, first recorded in the redo log, memory.

Then when idle, the redo log data is written to disk. So if the system collapse, and in-memory data, can be restored by uncommitted redo log

redo log is a log size limit. Similar to ring, write pos is written position, chekpoint disk refresh location.

When the contents of the disk is full, that is, write and chek point when pos met. Refresh your data to disk, and delete the corresponding redo log, to make room.

bin log recorded each time an operation DDL and DML operation.

When data misuse, can be restored to the desired state through the most recent backup data + bin log

Guess you like

Origin www.cnblogs.com/luoying/p/12083792.html