存儲引擎
類似于linux中的文件系統(tǒng)但是要比文件系統(tǒng)高級
mysql的存儲引擎類型
mysql> SHOW ENGINES;
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| CSV | YES | CSV storage engine | NO | NO | NO |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| MyISAM | YES | MyISAM storage engine | NO | NO | NO |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
| InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
查看默認的存儲引擎
mysql> show variables like '%engine%';
+----------------------------------+--------+
| Variable_name | Value |
+----------------------------------+--------+
| default_storage_engine | InnoDB |
| default_tmp_storage_engine | InnoDB |
| disabled_storage_engines | |
| internal_tmp_disk_storage_engine | InnoDB |
+----------------------------------+--------+
4 rows in set (0.00 sec)
mysql> select @@default_storage_engine;
+--------------------------+
| @@default_storage_engine |
+--------------------------+
| InnoDB |
+--------------------------+
innodb在mysql5.5以后為默認的存儲引擎
mylsam為5.5以前的默認存儲引擎
TokuDB :壓縮比高培慌,插入性能很高
MyRocks
RocksDB
innodb與myisam的區(qū)別
1.innodb支持事務
2.mvcc多版本并發(fā)控制
3.innodb為行級鎖,myisam為級鎖
4.ACSR自動故障安全恢復
5.支持熱備份
6.索引 B+tree
innodb新特性
修改一個表的存儲引擎
db01 [oldboy]>alter table t1 engine innodb;
注意:此命令我們經(jīng)常使用他柑爸,進行innodb表的碎片整理
待續(xù)吵护。。。