MySQL table indexes change location Is it possible to move the MySQL Table indexes to another location rather than "datadir" ? for example a ssd drive or memory partition ?
You cannot move just indexes to another location. You have to move both data and indexes.

When you use innodb_file_per_table, this will create a file with the extension .ibd.

For example, if you have an InnoDB table as follows


datadir /var/lib/mysql
database mydb
table mytable


The physical files are the following


/var/lib/mysql/mydb/mytables.frm
/var/lib/mysql/mydb/mytables.ibd


The file /var/lib/mysql/mydb/mytables.ibd contains both data and index pages for mydb.mytable.

If you have another disk (says an SSD or HDD) and you want the .ibd file to be moved over there, you may have to use the DATA DIRECTORY directive for the CREATE TABLE command.

Here is what the MySQL Documentation for CREATE TABLE says on this:


  DATA DIRECTORY, INDEX DIRECTORY
  
  For InnoDB, the DATA DIRECTORY='directory' option allows you to create
  new InnoDB file-per-table tablespaces in a location outside the MySQL
  data directory. Within the directory that you specify, MySQL creates a
  subdirectory corresponding to the database name, and within that a
  .ibd file for the new table. To use the DATA DIRECTORYoption with
  InnoDB tables, the innodb_file_per_table configuration option must be
  enabled. The directory must be the full path name to the directory,
  not a relative path. See Section 14.5.4, “Specifying the Location of a
  Tablespace” for additional information.


Just a heads up on this: INDEX DIRECTORY only applies to MyISAM not InnoDB.
Suppose you have an SSD mounted on /innodb_data and you ran chown -R mysql:mysql /innodb_data

Here is how you can move mydb.mytable (by essentially copying)

CREATE TABLE LIKE mydb.mytable_new DATA DIRECTORY '/innodb_data' LIKE mydb.mytable.
INSERT INTO mydb.mytable_new SELECT * FROM mydb.mytable;
DROP TABLE mydb.mytable;
ALTER TABLE mydb.mytable_new RENAME mydb.mytable;


If you are concerned with indexes in RAM, just tune the InnoDB Buffer Pool size.

Give it a Try !!!