I have a script that updates localhost, then dumps the updated results to remotehost:
mysqldump --skip-tz-utc --no-create-info --insert-ignore --host=localhost -u u -ppass db table --where=\"timeStamp > FROM_UNIXTIME( $time )\" | mysql -h remote -u u -ppass db
With 20 records, the update to localhost is very quick (a few seconds) but the dump to remotehost is taking over 4 minutes...when I look at mysql workbench, it says the state of remote host is "Repair by Sorting" and the Info column is "/*!40000 ALTER TABLE 'table' ENABLE KEYS */".
What does this message mean (and why is it taking so long to dump to remotehost with so few records)?
Thanks!
mysqldump
is disabling indexes, inserting the records, and re-enabling the indexes. This means it affects the entire table, including the many more records I expect are there based on the time.
Add --skip-disable-keys
to the arguments for mysqldump
and that should stop happening.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With