Open huhongbo opened 9 years ago
2、执行时间 ---tpcc start begin ---2015/01/30 14:34:23
* ###easy### TPC-C Load Generator *
option h with value 'localhost' option P with value '3306' option d with value 'tpcc1000' option u with value 'root' option p with value 'root' option w with value '100' option c with value '32' option r with value '60' option l with value '3600' option f with value 'onesql_tpcc_load_100warehouse.txt'
下面为使用gnuplot画图:
TOKUDB的优势在于压缩率和插入索引速度
好的,两者的TPCC测试完成后我再测试下压缩率和索引后的插入速度。
Onesql测试结果(TPCC): ---tpcc load begin ---2015/01/30 16:28:36
* ###easy### TPC-C Data Loader *
两种引擎的对比:
mysql> show table status \G;
*** 1. row ***
Name: onesql_size
Engine: InnoDB
Version: 10
Row_format: Compact
Rows: 10000433
Avg_row_length: 54
Data_length: 546308096
Max_data_length: 0
Index_length: 0
Data_free: 555745280
Auto_increment: NULL
Create_time: 2015-02-02 09:47:04
Update_time: NULL
Check_time: NULL
Collation: latin1_swedish_ci
Checksum: NULL
Create_options:
Comment:
*** 2. row ***
Name: tokudb_size
Engine: TokuDB
Version: 10
Row_format: tokudb_zlib
Rows: 10000000
Avg_row_length: 26
Data_length: 260000000
Max_data_length: 9223372036854775807
Index_length: 0
Data_free: 0
Auto_increment: NULL
Create_time: 2015-02-02 09:39:45
Update_time: 2015-02-02 09:39:45
Check_time: NULL
Collation: latin1_swedish_ci
Checksum: NULL
Create_options:
Comment:
2 rows in set (0.00 sec)
ERROR: No query specified
mysql> select count(1) from tokudb_size; +----------+ | count(1) | +----------+ | 10000000 | +----------+ 1 row in set (6.59 sec)
mysql> select count(1) from onesql_size; +----------+ | count(1) | +----------+ | 10000000 | +----------+ 1 row in set (7.44 sec)
两张同样表的不同引擎,tokudb占用空间为innodb的1/2 ?? (未开启inndb_file_per_table) 事实上打开innodb_file_per_table,观察空间占用情况为: mysql> show table status \G; *** 1. row *** Name: innodb_size_default Engine: InnoDB Version: 10 Row_format: Compact Rows: 10000433 Avg_row_length: 54 Data_length: 546308096 Max_data_length: 0 Index_length: 0 Data_free: 5242880 Auto_increment: NULL Create_time: 2015-02-02 12:35:09 Update_time: NULL Check_time: NULL Collation: latin1_swedish_ci Checksum: NULL Create_options: Comment: *** 2. row *** Name: split_insert Engine: InnoDB Version: 10 Row_format: Compact Rows: 10000433 Avg_row_length: 54 Data_length: 546308096 Max_data_length: 0 Index_length: 0 Data_free: 5242880 Auto_increment: NULL Create_time: 2015-02-02 11:13:50 Update_time: NULL Check_time: NULL Collation: latin1_swedish_ci Checksum: NULL Create_options: Comment: *** 3. row *** Name: tokudb_size_default Engine: TokuDB Version: 10 Row_format: tokudb_zlib Rows: 10000000 Avg_row_length: 26 Data_length: 260000000 Max_data_length: 9223372036854775807 Index_length: 0 Data_free: 0 Auto_increment: NULL Create_time: 2015-02-02 12:37:50 Update_time: 2015-02-02 12:37:50 Check_time: NULL Collation: latin1_swedish_ci Checksum: NULL Create_options: Comment: 3 rows in set (0.01 sec)
--默认压缩方式:
tokudb :tokudbzlib
innodb:Compact
root@pc-mon03:/usr/local/tokudb/data# ls -l .tokudb test/innodb_sizedefault.
-rw-rw---- 1 mysql mysql 8646 Feb 2 12:35 test/innodb_size_default.frm
-rw-rw---- 1 mysql mysql 562036736 Feb 2 12:36 test/innodb_size_default.ibd
-rw-rw---- 1 mysql mysql 64367616 Feb 2 12:38 _test_tokudb_size_default_main_2a_1_1b_B_0.tokudb
-rw-rw---- 1 mysql mysql 16384 Feb 2 12:37 _test_tokudb_size_default_status_28_1_1b.tokudb
tokudb引擎约为innodb引擎的1/10,空间使用大大减少
而使用了tokudb_lzma格式后,为之前tokudbzlib格式的1/3
root@pc-mon03:/usr/local/tokudb/data# ls -l .tokudb test/innodb_sizedefault.
-rw-rw---- 1 mysql mysql 8646 Feb 2 12:35 test/innodb_size_default.frm
-rw-rw---- 1 mysql mysql 562036736 Feb 2 12:36 test/innodb_size_default.ibd
-rw-rw---- 1 mysql mysql 26188800 Feb 2 12:46 _test_innodb_size_lzma_main_30_1_1b_B_0.tokudb
-rw-rw---- 1 mysql mysql 16384 Feb 2 12:45 _test_innodb_size_lzma_status_2e_1_1b.tokudb
-rw-rw---- 1 mysql mysql 64367616 Feb 2 12:38 _test_tokudb_size_default_main_2a_1_1b_B_0.tokudb
-rw-rw---- 1 mysql mysql 16384 Feb 2 12:37 _test_tokudb_size_default_status_28_1_1b.tokudb
下面采用innodb-plugin的Innodb_file_format = barracuda ;使用compressed压缩方式
root@pc-mon03:/usr/local/tokudb/data# ls -l .tokudb test/innodbsize.ibd
-rw-rw---- 1 mysql mysql 285212672 Feb 2 12:59 test/innodb_size_compressed.ibd
-rw-rw---- 1 mysql mysql 562036736 Feb 2 12:36 test/innodb_size_default.ibd
-rw-rw---- 1 mysql mysql 26188800 Feb 2 12:46 _test_innodb_size_lzma_main_30_1_1b_B_0.tokudb
-rw-rw---- 1 mysql mysql 16384 Feb 2 12:45 _test_innodb_size_lzma_status_2e_1_1b.tokudb
-rw-rw---- 1 mysql mysql 64367616 Feb 2 12:38 _test_tokudb_size_default_main_2a_1_1b_B_0.tokudb
-rw-rw---- 1 mysql mysql 16384 Feb 2 12:37 _test_tokudb_size_default_status_28_1_1b.tokudb
总结:
tokudb的lzma格式(空间为26188800)为innodb的compressed格式(285212672)的近1/10。压缩比非常明显。
mysql> alter table onesql_size add index(rowid); Query OK, 0 rows affected (0.02 sec) Records: 0 Duplicates: 0 Warnings: 0
mysql> alter table tokudb_size add index(rowid);
Query OK, 0 rows affected (0.03 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> insert into onesql_size select * from base_table; Query OK, 10000000 rows affected (1 min 29.01 sec) Records: 10000000 Duplicates: 0 Warnings: 0
mysql> commit; Query OK, 0 rows affected (0.00 sec)
mysql> insert into tokudb_size select * from base_table;
Query OK, 10000000 rows affected (1 min 35.09 sec)
Records: 10000000 Duplicates: 0 Warnings: 0
两张表创建相同索引后,插入效率相差不大。
以下结果为tpcc-mysql工具得出 Onesql测试结果: 1、LOAD ---tpcc load begin ---2015/01/30 12:44:24
* ###easy### TPC-C Data Loader *