12
返回列表 发新帖
楼主: 〇〇

TokuDB 6.5 tpch测试

[复制链接]
论坛徽章:
407
紫蛋头
日期:2012-05-21 10:19:41迷宫蛋
日期:2012-06-06 16:02:49奥运会纪念徽章:足球
日期:2012-06-29 15:30:06奥运会纪念徽章:排球
日期:2012-07-10 21:24:24鲜花蛋
日期:2012-07-16 15:24:59奥运会纪念徽章:拳击
日期:2012-08-07 10:54:50奥运会纪念徽章:羽毛球
日期:2012-08-21 15:55:33奥运会纪念徽章:蹦床
日期:2012-08-21 21:09:51奥运会纪念徽章:篮球
日期:2012-08-24 10:29:11奥运会纪念徽章:体操
日期:2012-09-07 16:40:00
11#
 楼主| 发表于 2012-10-15 19:54 | 只看该作者
二者之间的差异在STRAIGHT_JOIN和from中表的顺序,执行计划如下
mysql> explain select STRAIGHT_JOIN
    ->            s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment
    ->          from part, partsupp, supplier, nation, region
    ->          where p_partkey = ps_partkey and s_suppkey = ps_suppkey
    ->                and p_size = 15 and p_type like '%BRASS'
    ->                and s_nationkey = n_nationkey and n_regionkey = r_regionkey and r_name = 'EUROPE'
    ->                and ps_supplycost = (
    ->                 select STRAIGHT_JOIN min(ps_supplycost)
    ->                   from partsupp, supplier, nation, region
    ->                   where p_partkey = ps_partkey and s_suppkey = ps_suppkey
    ->                         and s_nationkey = n_nationkey and n_regionkey = r_regionkey and r_name = 'EUROPE')
    ->          order by s_acctbal desc, n_name, s_name,p_partkey limit 10;
+----+--------------------+----------+--------+---------------+---------+---------+---------------------------+---------+----------------------------------------------+
| id | select_type        | table    | type   | possible_keys | key     | key_len | ref                       | rows    | Extra                                        |
+----+--------------------+----------+--------+---------------+---------+---------+---------------------------+---------+----------------------------------------------+
|  1 | PRIMARY            | part     | index  | PRIMARY       | PRIMARY | 4       | NULL                      | 2000000 | Using where; Using temporary; Using filesort |
|  1 | PRIMARY            | partsupp | ref    | PRIMARY       | PRIMARY | 4       | tpch.part.p_partkey       |   80000 | Using where                                  |
|  1 | PRIMARY            | supplier | eq_ref | PRIMARY       | PRIMARY | 4       | tpch.partsupp.ps_suppkey  |       1 |                                              |
|  1 | PRIMARY            | nation   | eq_ref | PRIMARY       | PRIMARY | 4       | tpch.supplier.s_nationkey |       1 |                                              |
|  1 | PRIMARY            | region   | index  | PRIMARY       | PRIMARY | 4       | NULL                      |       5 | Using where; Using join buffer               |
|  2 | DEPENDENT SUBQUERY | partsupp | ref    | PRIMARY       | PRIMARY | 4       | tpch.part.p_partkey       |  800001 |                                              |
|  2 | DEPENDENT SUBQUERY | supplier | eq_ref | PRIMARY       | PRIMARY | 4       | tpch.partsupp.ps_suppkey  |       1 |                                              |
|  2 | DEPENDENT SUBQUERY | nation   | eq_ref | PRIMARY       | PRIMARY | 4       | tpch.supplier.s_nationkey |       1 |                                              |
|  2 | DEPENDENT SUBQUERY | region   | index  | PRIMARY       | PRIMARY | 4       | NULL                      |       5 | Using where; Using join buffer               |
+----+--------------------+----------+--------+---------------+---------+---------+---------------------------+---------+----------------------------------------------+
9 rows in set (0.00 sec)

使用道具 举报

回复
论坛徽章:
407
紫蛋头
日期:2012-05-21 10:19:41迷宫蛋
日期:2012-06-06 16:02:49奥运会纪念徽章:足球
日期:2012-06-29 15:30:06奥运会纪念徽章:排球
日期:2012-07-10 21:24:24鲜花蛋
日期:2012-07-16 15:24:59奥运会纪念徽章:拳击
日期:2012-08-07 10:54:50奥运会纪念徽章:羽毛球
日期:2012-08-21 15:55:33奥运会纪念徽章:蹦床
日期:2012-08-21 21:09:51奥运会纪念徽章:篮球
日期:2012-08-24 10:29:11奥运会纪念徽章:体操
日期:2012-09-07 16:40:00
12#
 楼主| 发表于 2012-10-15 19:55 | 只看该作者
原始计划
mysql> explain select
    ->         s_acctbal,
    ->         s_name,
    ->         n_name,
    ->         p_partkey,
    ->         p_mfgr,
    ->         s_address,
    ->         s_phone,
    ->         s_comment
    -> from
    ->         part,
    ->         supplier,
    ->         partsupp,
    ->         nation,
    ->         region
    -> where
    ->         p_partkey = ps_partkey
    ->         and s_suppkey = ps_suppkey
    ->         and p_size = 15
    ->         and p_type like '%BRASS'
    ->         and s_nationkey = n_nationkey
    ->         and n_regionkey = r_regionkey
    ->         and r_name = 'EUROPE'
    ->         and ps_supplycost = (
    ->                 select
    ->                         min(ps_supplycost)
    ->                 from
    ->                         partsupp,
    ->                         supplier,
    ->                         nation,
    ->                         region
    ->                 where
    ->                         p_partkey = ps_partkey
    ->                         and s_suppkey = ps_suppkey
    ->                         and s_nationkey = n_nationkey
    ->                         and n_regionkey = r_regionkey
    ->                         and r_name = 'EUROPE'
    ->         )
    -> order by
    ->         s_acctbal desc,
    ->         n_name,
    ->         s_name,
    ->         p_partkey
    -> limit 10;
+----+--------------------+----------+--------+---------------+---------+---------+---------------------------------------------+---------+---------------------------------+
| id | select_type        | table    | type   | possible_keys | key     | key_len | ref                                         | rows    | Extra                           |
+----+--------------------+----------+--------+---------------+---------+---------+---------------------------------------------+---------+---------------------------------+
|  1 | PRIMARY            | partsupp | index  | PRIMARY       | PRIMARY | 8       | NULL                                        | 8000000 | Using temporary; Using filesort |
|  1 | PRIMARY            | supplier | eq_ref | PRIMARY       | PRIMARY | 4       | tpch.partsupp.ps_suppkey                    |       1 |                                 |
|  1 | PRIMARY            | nation   | eq_ref | PRIMARY       | PRIMARY | 4       | tpch.supplier.s_nationkey                   |       1 |                                 |
|  1 | PRIMARY            | region   | index  | PRIMARY       | PRIMARY | 4       | NULL                                        |       5 | Using where; Using join buffer  |
|  1 | PRIMARY            | part     | eq_ref | PRIMARY       | PRIMARY | 4       | tpch.partsupp.ps_partkey                    |       1 | Using where                     |
|  2 | DEPENDENT SUBQUERY | supplier | index  | PRIMARY       | PRIMARY | 4       | NULL                                        |  100000 |                                 |
|  2 | DEPENDENT SUBQUERY | nation   | eq_ref | PRIMARY       | PRIMARY | 4       | tpch.supplier.s_nationkey                   |       1 |                                 |
|  2 | DEPENDENT SUBQUERY | region   | index  | PRIMARY       | PRIMARY | 4       | NULL                                        |       5 | Using where; Using join buffer  |
|  2 | DEPENDENT SUBQUERY | partsupp | eq_ref | PRIMARY       | PRIMARY | 8       | tpch.part.p_partkey,tpch.supplier.s_suppkey |       1 |                                 |
+----+--------------------+----------+--------+---------------+---------+---------+---------------------------------------------+---------+---------------------------------+
9 rows in set (0.01 sec)

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表