Please find the answers to your queries inline.
>We noticed that the 5.6.6-m9 code that handles the update rows log
>event on a slave looks as if it no longer fetches the row as MySQL 5.5
>does (5.5 calls find_row to fetch the row) before calling the storage
>engine update_row method. Here are some questions:
Don't worry if you cannot find find_row(). This has been replaced by
three algorithms to find
the row to be updated corresponding to a row in a row event.
>1. Is it in fact the case that 5.6 does not read the row when
>executing update log events on the slave?
This is not entirely true. In 5.6 the number of times the rows are read from
the table may or may not be less than that in mysql 5.5. This is due to
of new slave row search algorithms. There are three row search
HASH_SCAN (new in mysql-5.6)
TABLE_SCAN (this is the only way of finding rows in 5.5 in a table w/o
INDEX_SCAN (this is the only way of finding rows in 5.5 in a table with
These algorithms are configurable in 5.6. see
A detailed explanation of this can be found here.
>The log event has the
>before and after update versions of the row, so reading the row seems
Yes the log event contains the before and the After Image. but this
doesnot make the
fetching of the rows from the table redundant. We have to find the
appropriate row in the table
to apply the after image. I agree that the "primitive" method of finding
and applying the rows are
costly and often results in O(n^2) complexity which will be resolved by
using HASH SCAN.
>2. Why was this change made?
These changes were made to incorporate the HASH SCAN algorithm and
enable new configurable
>3. Can the same change be applied to MySQL 5.5? If so, are there any
>addition changed needed?
Applying these changes in 5.5 is not advised because these are extensive
changes in how slave applies row events
and is to some extent dependent on some other features in 5.6 namely
optimized row images etc.
> Rich Prohaska
Rohit Kalhans, Software Dev. MySQL Replication
“Before you criticize someone, you should walk a mile in their shoes.
That way when you criticize them, you are a mile away from them and you
have their shoes.”