Accelerate MySQL index query using an SSD Hard Disk
For more information, see: http://www.javaarch.net/jiagoushi/index.htm
If the data volume is large and the SSD capacity is not large, you can save the index data to the SSD to store the table data on the old hard disk.
So how can MySQL build index on SSD and use index data on SSD?
1. Create several directories on SSD
Mkdir/SSD/mysql_indexes
Mkdir/SSD/mysql_indexes/my_big_db_name
Chmod 700/SSD/mysql_indexes
Chown-r MYSQL: MySQL/SSD/mysql_indexes
2. If you use the MyISAM engine, you can add the following configuration in MySQL configuration to accelerate index reconstruction.
[Mysqld]
Myisam_repair_threads = 10
3. Finally, execute the following query to allow MySQL to switch the index data location of the table.
Alter table my_table index directory = '/SSD/mysql_indexes/my_big_db_name ';
This must wait until the index of MySQL is rebuilt to make it obvious that the database is getting faster.