Some times it’s important to know the size of a transaction, especially when you plan to migrate to a HA solution where by default transactions have a limited size to guarantee an optimal behavior of the cluster.
Today we will see the different possibilities to have an idea of the size of transactions.
First we need to split the transaction in two types:
- those generating data (writes, like insert, delete and update, DML)
- those only ready data (select, DQL)
To implement High Availability, only the first category is important.
Size of DML
To know the size of a DML transaction, the only possibility we have is to parse the binary log (or query the binlog event).
We need to check the binlog event from the binlog file and then calculate its size. To illustrate this, let’s try to find the transaction identified by a specific GTID: …[Read more]