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实战
Presto
的架构
53
示例
4-5
 
局部预聚合可以显著提高性能
...
- Aggregate[by nationkey...; orders_sum := sum(totalprice)]
- InnerJoin[c.custkey = o.custkey]
- InnerJoin[n.nationkey = c.nationkey]
- TableScan[nation]
- TableScan[customer]
- Aggregate[by custkey; totalprice := sum(totalprice)]
- TableScan[orders]
...
为了提高并行性,这类预聚合采用所谓
局部聚合
partial aggregation
)来实现。这里只显
示了简化的查询计划,如果你实际运行
EXPLAIN
命令查看查询计划,得到的结果会与这里
显示的不同。
示例
4-5
中显示的预聚合并不一定总能提高性能。如果局部聚合不能减少数
据量,则其将对查询性能有害。因此,此优化规则目前是默认禁用的,你可
以使用
push_partial_aggregation_through_join
会话选项来激活它。默认情
况下,
Presto
将局部聚合放置在
Join
之上以减少
Presto
节点之间通过网络传
输的数据量。要充分利用局部聚合,我们可能需要考虑非简化的查询计划。
4.10
 实现规则
目前,我们所讨论的都是优化规则,它们的目的是缩短查询处理时间、降低查询内存消耗
和减少通过网络传输的数据量。然而,即使在我们的示例查询中 ...
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.
Start your free trial

You might also like

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

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

Ted Malaska, Jonathan Seidman
Google系统架构解密: 构建安全可靠的系统

Google系统架构解密: 构建安全可靠的系统

Heather Adkins, Betsy Beyer, Paul Blankinship, Piotr Lewandowski, Ana Oprea, Adam Stubblefield

Publisher Resources

ISBN: 9787115560056