On Fri, Jul 4, 2014 at 10:26 AM, Kristian Nielsen <knielsen@knielsen-hq.org> wrote:
Jonas Oreland <jonaso@google.com> writes:

> <quick thoughts on implementation>
> for row-based replication this seems quite "easy".
>
> for statement-based replication i image that you would have to add hooks
> into the "real" code
> after parsing has been performed, but before the actual execution is
> started (and yes, i know that there is sometimes a blurry line here)
> </thoughts>

A different approach could be to do this on the master.
When a transaction is binlogged, we have easy access to most/all of this
information. And there is room in the GTID event at the start of every binlog
event group to save this information for the slave. Then the slave has the
information immediately when it starts scheduling events for parallel
execution. So this does not sound too hard. Though the amount of information
that can be provided is then somewhat limited for space and other reasons, of
course.

or perhaps a hybrid approach.
master does "interesting" annotations
slave takes decision based on annotations *and* own analysis

/Jonas