Skip to content
Replication Internals: Decoding the MySQL Binary Log - Part 6: QUERY_EVENT — DDL Statements and Transaction Boundaries
← Back to blogDatabase Scaling

Replication Internals: Decoding the MySQL Binary Log - Part 6: QUERY_EVENT — DDL Statements and Transaction Boundaries

In this sixth post of our series, we decode the QUERY_EVENT — the workhorse event that records DDL statements and transaction boundaries. Introduction The QUERY_EVENT (event type 2, 0x02) is one of the most versatile events in a binary log. It records: DDL statements: CREATE, ALTER, DROP, TRUNCATE, etc. Transaction boundaries: BEGIN statements that start a transaction * Statement-based DML: In statement-based replication mode, INSERT/UPDATE/DELETE Even in row-based replication (the d

Marcelo Altmann

Marcelo Altmann

2026-04-01 · 16 min read

Want to see Readyset in action?

Book a demo and see how Readyset can accelerate your database.