Re: speedup mysql restore

2007-05-21 Thread Eric Bergen
The best way to speed up restores is to not use mysqldump at all. Instead take a snapshot of the filesystem with something like mylvmbackup. Then restore is as fast as copying the files over. Also mysqldump adds disable keys and disable unique checks to the output by default when using the --opt

Re: speedup mysql restore

2007-05-20 Thread Ray Cauchi
Have you tried using the > use db > source /path/to/dumpfile.sql command via the mysql command line client? At 08:28 AM 5/20/2007, Vitaliy Okulov wrote: Çäðàâñòâóéòå, mysql. How i can speedup restore of mysql DB from file created by mysqldump? MySQL is quite fast at reloading data, but if

Re: speedup mysql restore

2007-05-20 Thread mos
At 08:28 AM 5/20/2007, Vitaliy Okulov wrote: Çäðàâñòâóéòå, mysql. How i can speedup restore of mysql DB from file created by mysqldump? MySQL is quite fast at reloading data, but if you don't have enough memory or if key_buffer_size is not set high enough, then it can take days to re-index t

Re: speedup mysql restore

2007-05-20 Thread Baron Schwartz
Vitaliy Okulov wrote: > > How i can speedup restore of mysql DB from file created by mysqldump? [snip] Ok, but for innodb? 1) Disable foreign key checks: SET FOREIGN_KEY_CHECKS=0 (remember to re-enable afterwards). Disable unique checks too: SET UNIQUE_CHECKS=0 2) Insert the rows in primar

Re: speedup mysql restore

2007-05-20 Thread Mogens Melander
--disable-keys, -K For each table, surround the INSERT statements with /*!4 ALTER TABLE tbl_name DISABLE KEYS */; and /*!4 ALTER TABLE tbl_name ENABLE KEYS */; statements. This makes loading the dump file faster because the indexes are created after all rows are inserted. This option is ef