I have read that table index compression happens just in MyISAM, but I came across
an article in dev.mysql that said: InnoDB supports table and index compression!
So now what is the pros of MyISAM?
Is there any reason left to use MyISAM? (except full-text search)
InnoDB Table Compression – How to Implement in MySQL
innodbmyisamMySQL
Related Question
- MySQL Storage Engine – Which One to Choose?
- Mysql – InnoDB possible error
- Mysql – Which MySQL storage engine is the most similar to ARCHIVE when that is not available
- MySQL – Choosing Between MYISAM and INNODB Engines
- Mysql – Spatial Index on an InnoDB table
- Mysql – Best configuration for MySQL? InnoDB and MyISAM
- Mysql – Convert MyISAM to InnoDB
Best Answer
Recovering Disk Space
As far as recovering InnoDB diskspace goes, you only have to migrate data out of ibdata1 and import it back one time if you enable innodb_file_per_table.
Once you do that, any InnoDB table that gets bloated can be shrunk. For example, if you have an InnoDB called
mydb.mytable
, you can shrink it with:or
Restoring Databases
@Craig is totally right on MyISAM.
As for InnoDB, restoring tables individually can be a nightmare. This is the case because tables are either inside ibdata1 (innodb_file_per_table=0) or outside (innodb_file_per_table=1).
ALTER TABLE tblname DISCARD TABLESPACE
andALTER TABLE tblname IMPORT TABLESPACE
because the tablespace id is hardcoded. You have to write some custom adhoc scripts to pull off such a miracle in conjunction withALTER TABLE tblname DISCARD TABLESPACE
andALTER TABLE tblname IMPORT TABLESPACE
.