On Mar 05, Andrej van der Zee wrote:
> I was wondering if it is possible to efficiently bulk-insert binary
> rows in a remote MySQL server. In my setup, currently I collect
> low-level resource data for each MySQL query. I modified the
> server-code to read hardware counters and write the results in
> (binary) bulk inserts into tables in the same database server. This is
> done in a background thread. But, now I would like to write the
> binary data to a remote MySQL server as efficient as possible, i.e.
> without (de)serializing the binary data to strings before it goes over
> the wire. To make a long story short, is it possible to do binary bulk
> inserts to a remote MySQL server from within a background thread in a
> MySQL server? How could I do this?
Either by using the client API and prepared statements - then you won't
need to convert your binary data to strings, and you can bulk-insert many
rows at once.
Or by replicating your changes to a remote server using rbr (again, to
avoid serialization to strings).
Regards / Mit vielen Grüßen,
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg@stripped>
/ /|_/ / // /\ \/ /_/ / /__ Principal Software Engineer/Server Architect
/_/ /_/\_, /___/\___\_\___/ Sun Microsystems GmbH, HRB München 161028
<___/ Sonnenallee 1, 85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Dr. Roland Boemer
Vorsitzender des Aufsichtsrates: Martin Häring