首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

Infobright与ToKuDB储存引擎对比测试

2013-08-10 
Infobright与ToKuDB存储引擎对比测试Infobright是开源的MySQL数据仓库解决方案,引入了列存储方案,高强度的

Infobright与ToKuDB存储引擎对比测试

Infobright是开源的MySQL数据仓库解决方案,引入了列存储方案,高强度的数据压缩,优化的统计计算(类似sum/avg/group by之类)。
TokuDB是一个高性能、支持事务处理的MySQL和MariaDB的存储引擎,其主要特点是对高写压力的支持。
我们针对以上两种特殊引擎,和InnoDB作了个简单的对比测试。

?

压缩性能

?InnoDB、Infobright、ToKuDB占用存储空间

同等数据表history(zabbix后台数据表)占用空间情况如下:


Infobright与ToKuDB储存引擎对比测试
?

Infobright与ToKuDB储存引擎对比测试
?
从各引擎存储数据的大小看,Infobright引擎可以让数据获得更大限度的压缩,占用空间最少。

?

?

常用语句执行效率测试

table (rows)

Action

innodb

Infobright

ToKuDB

history(0)

load 427801328 rows

2 hours 5.96

23 min 29.03 sec

6 hours 57 min 1.08 sec

history(427801328)

insert 1million again

49.70 sec

/

55.07 sec

history(427801328)

select count(*) from

13 min 58.01 sec

0.11 sec

3 min 3.27 sec

history_str(27434968)

delete /274349 rows

24.16s

/

2 min 22.32 sec

history_str(27434968)

update/1million rows

21.22 sec

/

28.08 sec

history_str(27434968)

truncate table

4.63 sec

/

1.96 sec

?

?

常用查询性能测试比较

使用单表history_str,数据量27434968条:

Infobright与ToKuDB储存引擎对比测试
?

?

Innodb、tokudb、infobright的表结构,数据量,索引均一样(infobright无索引)

?

执行语句innodbinfobrightTokuDBselect avg(clock) from history_str11.54 sec0.00 sec8.67 secselect max(itemid+clock) from history_str14.36 sec6.77 sec12.21 secselect max(length(clock)) from history_str12.67 sec4.44 sec9.99 secselect max(right(clock,4)) from history_str14.07 sec11.76 sec11.09 secselect count(distinct(clock)) from history_str12.97 sec2.68 sec13.86 sec    select count(*) from (select clock from history_str group by clock) as a14.63 sec4.69 sec15.92 secselect count(*) from (select count(clock) from history_str group by clock) as a10.51 sec5.86 sec7.84 secselect count(*) from (select count(*) from history_str group by clock,itemid) as a8 min 44.97 sec29.00 sec7 min 54.71 secselect clock from history_str group by clock,itemid order by itemid desc limit 100;8 min 12.07 sec0.00 sec7 min 24.31 sec    select count(*) from history_str where itemid+clock>135813453511.83 sec15.33 sec8.53 sec    select count(*) from history_str where clock>ns;11.41 sec0.00 sec8.28 secselect * from history_str where clock>itemid into outfile '/tmp/h.txt'32.75 sec50.06 sec25.82 sec    select count(*) from history_str where right(clock,3)=100;15.40 sec18.18 sec11.04 secselect count(*) from history_str where position('m' in value)>015.41 sec2.32 sec8.72 secselect count(*) from history_str where greatest(clock,1357868025)=clock10.69 sec10.88 sec8.24 sec    select count(*) from history_str where value like '%true%'13.89 sec0.15 sec8.16 sec    select count(*) from history_str where value in ('true','19ms','9ms');11.33 sec0.12 sec8.33 secselect count(*) from history_str where value in ('true','19ms','9ms') and clock <1359808970;1.70 sec0.11 sec5.62 sec    select count(*) from history_str as a join history_str as b on a.itemid=b.itemid where a.clock<1357908970;1 min 34.35 sec2.93 sec2 min 17.89 secselect count(*) from history_str as a join history_str as b on a.itemid=b.itemid where a.clock<1357908970 and b.itemid<266631;41.61 sec3.32 sec1 min 0.66 sec

?

?

小结:

在大部分情况下,infobright具有很好查询性能,远胜innodb、tokudb两种引擎,但是不支持DML,DDL(alter table、truncate table等)语句,语法比较简单,限制也比较多,Infobright还有很多查询注意事项,编写代码的时候需要注意。

Tokudb在走相同索引的情况下,部分情况会优胜innodb,但是数据量非海量的时候,查询优势并不明显。

?

?

热点排行