Skip to Content
Presto实战
book

Presto实战

by Matt Fuller, Manfred Moser, Martin Traverso
March 2021
Intermediate to advanced
265 pages
6h 50m
Chinese
Posts & Telecom Press
Content preview from Presto实战
60
4
时,查询执行期间只会读取匹配的分区。此外,由于
Hive
中每个分区单独保存表统计信
息,因此
CBO
只使用相关分区的统计信息,从而更加精确。
当然,任何连接器都可以为过滤后的关系表提供这类改进后的统计信息,但这里仅参考
Hive
连接器提供这类统计信息的方式。
4.11.6
 
Join
枚举
至此,我们讨论了
CBO
如何使用数据统计信息生成执行查询的最优计划。尤其是,它会
选择最优
Join
顺序,该
Join
顺序会显著地影响查询性能,原因如下所示。
Hash Join
的实现
Hash Join
的实现是非对称的
,非常重要的是仔细选择哪一个输入用于构建侧,哪一个
用于探测侧。
分布式
Join
的类型
非常重要的是仔细选择,
Join
的输入数据是广播的还是重分布的。
4.11.7
 广播
Join
和分布式
Join
4.11.6
节中,你了解了
Hash Join
的实现以及选择构建侧和探测侧的重要性。由于
Presto
是分布式系统,因此
Join
以在一个集群的工作节点上并行执行,每个工作节点处理
Join
的一部分任务。要执行分布式
Join
,数
据可能需要在网络上分发。根据数据的形状,不同
的策略效率可能差别很大。
1.
广播
Join
策略
广播
Join
策略
中,
Join
的构建侧广播到并行执行
Join
的所有工作节点上
。换句话说,
每个工作节点上的
Join
得到构建侧数据的一个完整副本(如图
4-12
所示)。只有当探测
侧在工作节点上无重复地分布时,这种策略才会提供正确的语义,否则会产生重复数据。
工作节点 1 工作节点 2 工作节点 3
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

大数据项目管理:从规划到实现

大数据项目管理:从规划到实现

Ted Malaska, Jonathan Seidman
机器学习流水线实战

机器学习流水线实战

Hannes Hapke, Catherine Nelson

Publisher Resources

ISBN: 9787115560056