TokuDB调研文档
另见链接:http://note.youdao.com/share/?id=77dd1e9cc139b57586665f702467c56a&type=note
INSTALL PLUGIN tokudb SONAME ‘ha_tokudb.so‘; INSTALL PLUGIN tokudb_file_map SONAME ‘ha_tokudb.so‘; INSTALL PLUGIN tokudb_fractal_tree_info SONAME ‘ha_tokudb.so‘; INSTALL PLUGIN tokudb_fractal_tree_block_map SONAME ‘ha_tokudb.so‘; INSTALL PLUGIN tokudb_trx SONAME ‘ha_tokudb.so‘; INSTALL PLUGIN tokudb_locks SONAME ‘ha_tokudb.so‘; INSTALL PLUGIN tokudb_lock_waits SONAME ‘ha_tokudb.so‘;
mysql> CREATE TABLE `City` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `Name` char(35) NOT NULL DEFAULT ‘‘, `CountryCode` char(3) NOT NULL DEFAULT ‘‘, `District` char(20) NOT NULL DEFAULT ‘‘, `Population` int(11) NOT NULL DEFAULT ‘0‘, PRIMARY KEY (`ID`), KEY `CountryCode` (`CountryCode`) ) ENGINE=TokuDB |
mysql> ALTER TABLE City ENGINE=TokuDB; |
mysql> insert into City_tokudb(ID) values(1);
Query OK, 1 row affected (0.00 sec)
mysql> insert into City_innodb(ID) values(1);
Query OK, 1 row affected (0.00 sec)
mysql> begin;
Query OK, 0 rows affected (0.00 sec)
mysql> insert into City_innodb(ID) values(2);
Query OK, 1 row affected (0.00 sec)
mysql> insert into City_tokudb(ID) values(2);
Query OK, 1 row affected (0.00 sec)
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> select * from City_innodb;
+----+------+-------------+----------+------------+
| ID | Name | CountryCode | District | Population |
+----+------+-------------+----------+------------+
| 1 | | | | 0 |
| 2 | | | | 0 |
+----+------+-------------+----------+------------+
2 rows in set (0.00 sec)
mysql> select * from City_tokudb;
+----+------+-------------+----------+------------+
| ID | Name | CountryCode | District | Population |
+----+------+-------------+----------+------------+
| 1 | | | | 0 |
| 2 | | | | 0 |
+----+------+-------------+----------+------------+
2 rows in set (0.00 sec)
|
mysql> CREATE TABLE `City_repl` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `Name` char(35) NOT NULL DEFAULT ‘‘, `CountryCode` char(3) NOT NULL DEFAULT ‘‘, `District` char(20) NOT NULL DEFAULT ‘‘, `Population` int(11) NOT NULL DEFAULT ‘0‘, PRIMARY KEY (`ID`), KEY `CountryCode` (`CountryCode`) ) ENGINE=TokuDB;
Query OK, 0 rows affected (0.01 sec)
mysql> insert into City_repl(ID) values(1);
Query OK, 1 row affected (0.00 sec)
mysql> insert into City_repl(ID) values(2);
Query OK, 1 row affected (0.00 sec)
mysql> delete from City_repl where ID=1;
Query OK, 1 row affected (0.00 sec)
mysql> update City_repl set ID=3 where ID=2;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
|
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| City_repl |
+----------------+
1 row in set (0.00 sec)
mysql> select * from City_repl;
+----+------+-------------+----------+------------+
| ID | Name | CountryCode | District | Population |
+----+------+-------------+----------+------------+
| 1 | | | | 0 |
| 2 | | | | 0 |
+----+------+-------------+----------+------------+
2 rows in set (0.00 sec)
mysql> select * from City_repl;
+----+------+-------------+----------+------------+
| ID | Name | CountryCode | District | Population |
+----+------+-------------+----------+------------+
| 2 | | | | 0 |
+----+------+-------------+----------+------------+
1 row in set (0.00 sec)
mysql> select * from City_repl;
+----+------+-------------+----------+------------+
| ID | Name | CountryCode | District | Population |
+----+------+-------------+----------+------------+
| 3 | | | | 0 |
+----+------+-------------+----------+------------+
|
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。