MySQL 5.6 on Centos 7
I have two very large tables (table A has 65 million rows and table B has 135 million rows) that I need to merge into a third table (lets call it table C). Table C is partitioned on the CREATED_TS column. A and B are identical except that they come from different "sources" and so in table C there is an extra column call OrigSource that has a code in it.
I have created a stored proc that cycles through each table and inserts 50K to 100K rows at a time but my issue is that it takes forever to run. For Table A it took 10-12 hours and for table B it is still running after about 18 hours.
Is there a better, faster way to do this? Can I export the tables with MySQLDump or something and then reinsert them into the new table? Is there some kind of utility that will do this in a faster way?
Any suggestions would be greatly appreciated . Thank you.