Jonas Oreland <jonaso@google.com> writes:A different approach could be to do this on the master.
> <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>
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.