Mysql5.6以后,說 innode 的 select 性能不輸 myisam 了,為什么 ?
問題描述
問題解答
回答1:感覺樓主不必糾結(jié)這個問題,InnoDB是MySQL官方指定的默認(rèn)引擎,維護力度都下在InnoDB身上了,SELECT性能更好也并不出奇.第三方的Percona Server也是選擇基于InnoDB改進推出XtraDB.所以還是盡量使用InnoDB吧.
InnoDB使用獨立表空間(innodb_file_per_table=1)后每個數(shù)據(jù)庫的每個表都會生成一個數(shù)據(jù)空間(.ibd文件).show variables like ’innodb_file_per_table’可見Percona Server 5.6是默認(rèn)開啟'獨立表空間'的.獨立表空間優(yōu)點:1.每個表都有自已獨立的表空間.2.每個表的數(shù)據(jù)和索引都會存在自已的表空間中.3.可以實現(xiàn)單表在不同的數(shù)據(jù)庫中移動.4.空間可以回收.
InnoDB表(innodb_file_per_table=1):
/png/percona/5.6/data/wordpress/wp_users.frm 表結(jié)構(gòu)/png/percona/5.6/data/wordpress/wp_users.ibd 數(shù)據(jù)和索引
對比MyISAM表:
/png/percona/5.6/data/mysql/users.frm 表結(jié)構(gòu)/png/percona/5.6/data/mysql/users.MYD 數(shù)據(jù)/png/percona/5.6/data/mysql/users.MYI 索引
