Resolve the difference between mysql binary log processing transactions and non transactional statements

  • 2020-05-19 06:03:55
  • OfStack

During the execution of transactional statements, the server will perform additional processing. Multiple transactions are executed in parallel during the execution of the server. In order to keep their records in 1, the concept of transaction caching needs to be introduced. When the transaction is committed, 1 is flushed to the binary log. Processing of non-transactional statements. Follow these three rules:

1) if a non-transactional statement is marked as transactional, it will be written to the transaction buffer.

2) if it is not marked as a transactional statement and is not in the transaction cache, write directly to the binary log.

3) write the transaction buffer if it is not marked as transactional, but it is in the transaction cache.

Note that if you have a non-transactional statement in a transaction, rule 2 will be used to write the non-transactional statement directly to the binary log in preference to the non-transactional statement.


Related articles: