mysql存储引擎介绍
MYSQL支持以下几种存储引擎:
ARCHIVE(archive):这种模式是用于数据存档的引擎,这种情况下数据行被插入后就不能再修改了
BLACKHOLE(blackhole):这种引擎的写操作是删除数据,读操作是返回空白记录
CSV:这种引擎在存储数据时以逗号作为数据项之间的分隔符
EXAMPLE(example):示例(存根)存储引擎
Falcon:用来进行事物处理的存储引擎
FEDERATED(federated):用来访问远程数据表的存储引擎
InnoDB:具备外键功能的事物处理引擎
MEMORY(memory):内存里的事物表
MERGE(merge):用来管理由多个MyISAM数据表构成的数据集合
MyISAM:默认引擎
NDB:MySQL Cluster专用存储引擎
如果需要查看自己mysql的存储引擎,直接输入命令SHOW ENGINES就可以了,以下是我自己cmd模式下查看自己mysql得到的信息:
mysql>SHOW ENGINES\G;
*************************** 1. row ***************************
Engine: MyISAM
Support: YES
Comment: Default engine as of MySQL 3.23 with great performance
Transactions: NO
XA: NO
Savepoints: NO
*************************** 2. row ***************************
Engine: CSV
Support: YES
Comment: CSV storage engine
Transactions: NO
XA: NO
Savepoints: NO
*************************** 3. row ***************************
Engine: MRG_MYISAM
Support: YES
Comment: Collection of identical MyISAM tables
Transactions: NO
XA: NO
Savepoints: NO
*************************** 4. row ***************************
Engine: BLACKHOLE
Support: YES
Comment: /dev/null storage engine (anything you write to it disappears)
Transactions: NO
XA: NO
Savepoints: NO
*************************** 5. row ***************************
Engine: FEDERATED
Support: NO
Comment: Federated MySQL storage engine
Transactions: NULL
XA: NULL
Savepoints: NULL
*************************** 6. row ***************************
Engine: InnoDB
Support: DEFAULT
Comment: Supports transactions, row-level locking, and foreign keys
Transactions: YES
XA: YES
Savepoints: YES
*************************** 7. row ***************************
Engine: ARCHIVE
Support: YES
Comment: Archive storage engine
Transactions: NO
XA: NO
Savepoints: NO
*************************** 8. row ***************************
Engine: MEMORY
Support: YES
Comment: Hash based, stored in memory, useful for temporary tables
Transactions: NO
XA: NO
Savepoints: NO
Support栏里面的YES或NO代表该存储引擎是否可用,DISABLED的意思是该存储引擎可用但它被关闭了,DEFAULT表示是服务器默认的存储引擎,一般来说,默认的是可用的!
Transaction栏里面的值表示存储引擎是否支持事物,XA和Savepoints栏里的值表明该存储引擎是否支持分布式事物处理和部分事物回滚。
mysql> SELECT ENGINE FROM INFORMATION_SCHEMA.ENGINES WHERE TRANSACTIONS = 'YES';
+--------+
| ENGINE |
+--------+
| InnoDB |
+--------+
以上语句同SHOW ENGINES,得出结果是在MySQL5.1版本下的,在MySQL6.0下的结果还会包括Falcon。