使用mapjoin效率对比
来源:互联网 发布:毛笔字在线生成器软件 编辑:程序博客网 时间:2024/06/05 03:35
MAPJION会把小表全部读入内存中,在map阶段直接拿另外一个表的数据和内存中表数据做匹配,由于在map是进行了join操作,省去了reduce运行的效率也会高很多
使用一个表测试,该表时5分钟表,数据很少,大概60多w。
测试日志里包含多个字段,其中有uid和uip。测试场景为给出2个uid,取uid共同的uip。
三个不同uid
select /*+ MAPJOIN(c) */
distinct c.ip from
(select /*+ MAPJOIN(a) */
a.ip from
(select ip from t where uid=uid1) a
join
(select ip from t where uid=uid2) b
on a.ip=b.ip
) c
join
(select ip from t where uid=uid3) d
on c.ip=d.ip
耗时 79.915 seconds 用4个mr
不适用mapjoin
select
distinct c.ip from
(select
a.ip from
(select ip from t where uid=uid1) a
join
(select ip from t where uid=uid2) b
on a.ip=b.ip
) c
join
(select ip from t where uid=uid3) d
on c.ip=d.ip
4个mr 耗时:90.932 seconds
结果一致.
效率提高了12%
- 使用mapjoin效率对比
- 游标使用效率对比
- hive mapjoin使用
- #Hive#Mapjoin的使用
- hive mapjoin使用
- hive mapjoin使用
- hive mapjoin使用
- hive mapjoin使用
- hive mapjoin使用
- hive mapjoin使用
- hive使用mapjoin
- hive mapjoin使用
- hive mapjoin使用
- hive mapjoin使用
- hive mapjoin 使用
- Hive中Mapjoin的使用
- 使用hibernate前后的效率对比
- hive mapjoin 使用 和个人理解
- VS2010 配置QT
- 类型码,似乎是对于构造成java枚举类似的应用。
- C# 操作Excel ——Excel获取数据、时间、图片
- Spring 2.x AOP声明式配置+声明式事务管理
- Java按行读取文件
- 使用mapjoin效率对比
- 孙鑫VC++学习记录1_windows运行机制
- oracle 自定义函数实例
- SQL Server里的 ISNULL 与 NULLIF
- POJ 2945 Find the Clones
- struts2中文乱码
- 经典PVST+到Rapid-PVST+迁移配置示例
- C# 深度解说值传参和引用传参的原理
- PHP框架收集