falcon在6。0以后被支持,要想查看当前版本是否支持falcon,可以用如下命令:
mysql> show engines;
+------------+---------+----------------------------------------------------------------+--------------+-----+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+------------+---------+----------------------------------------------------------------+--------------+-----+------------+
| FEDERATED | YES | Federated MySQL storage engine | NO | NO | NO |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| Falcon | YES | Falcon storage engine | YES | NO | YES |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | 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 | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO |
+------------+---------+----------------------------------------------------------------+--------------+-----+------------+
9 rows in set (0.01 sec)
创建falcon的表很简单,和创建其他表一样:
mysql> CREATE TABLE tbl1 (id INTEGER AUTO_INCREMENT PRIMARY KEY, value VARCHAR(30)) ENGINE=Falcon;
Query OK, 0 rows affected (0.19 sec)
mysql> use information_schema
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select * from FALCON_TABLES;
+-------------+------------+-----------+-------------+---------------+
| SCHEMA_NAME | TABLE_NAME | PARTITION | TABLESPACE | INTERNAL_NAME |
+-------------+------------+-----------+-------------+---------------+espace
| TEST | TBL1 | | FALCON_USER | TBL1 |
| TEST | TBL2 | | tb1 | TBL2 |
+-------------+------------+-----------+-------------+---------------+
2 rows in set (0.00 sec)
如果要增加数据文件,目前看似乎还没有实现,测试如下:
mysql> alter tablespace tb1 add datafile 'data01_1' engine=falcon;
ERROR 1178 (42000): The storage engine for the table doesn't support
上述语句目前只有NDB存储引擎可以使用。