Mysql5.6以后,說(shuō) innode 的 select 性能不輸 myisam 了,為什么 ?
問(wèn)題描述
問(wèn)題解答
回答1:感覺(jué)樓主不必糾結(jié)這個(gè)問(wèn)題,InnoDB是MySQL官方指定的默認(rèn)引擎,維護(hù)力度都下在InnoDB身上了,SELECT性能更好也并不出奇.第三方的Percona Server也是選擇基于InnoDB改進(jìn)推出XtraDB.所以還是盡量使用InnoDB吧.
InnoDB使用獨(dú)立表空間(innodb_file_per_table=1)后每個(gè)數(shù)據(jù)庫(kù)的每個(gè)表都會(huì)生成一個(gè)數(shù)據(jù)空間(.ibd文件).show variables like ’innodb_file_per_table’可見(jiàn)Percona Server 5.6是默認(rèn)開(kāi)啟'獨(dú)立表空間'的.獨(dú)立表空間優(yōu)點(diǎn):1.每個(gè)表都有自已獨(dú)立的表空間.2.每個(gè)表的數(shù)據(jù)和索引都會(huì)存在自已的表空間中.3.可以實(shí)現(xiàn)單表在不同的數(shù)據(jù)庫(kù)中移動(dòng).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ù)和索引
對(duì)比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 索引
