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实战
50
4
现在我们来考虑下这个查询计划的计算复杂度。在知道实际实现细节之前,我们无法准确
地推测一个查询计划的复杂度,但可以假设一个查询计划节点的计算复杂度不会低于其产
生数据集的行数。因此,我们可以用描述渐近复杂度下界的大
Omega
表示法来估算复杂
度。如果
N
O
C
R
分别表示表
nation
orders
customer
region
表的行数,则有
以下内容。
•
TableScan[orders]
算子读取
orders
表并返回
O
行数据,则其复杂度是
Ω
(
O
)
。类似地,
nation
customer
表的
TableScan
分别返回
N
C
行,因此其复杂度分别为
Ω
(
N
)
Ω
(
C
)
•
TableScan[nation]
TableScan[orders]
之上的
CrossJoin
节点返回
nation
orders
表中行的组合(正交积),因此其复杂度是
Ω
(
N
×
O
)
•
再之上的
CrossJoin
节点将之前返回
N
×
O
行的
CrossJoin
节点的输出,与
TableScan[customer]
的输出相结合,
customer
表输出的行数是
C
,因此总的复杂度是
Ω
(
N
×
O
×
C
)
•
底层的
TableScan[region]
复杂度为
Ω
(
R
)
,但其上的
LateralJoin
会调用它
N
次,聚合
之后一共有
N
行被返回,因此总的计算复杂度是
Ω
(
R
×
N
)
•
Sort
操作需要排序
N
行,它的计算复杂度不小于
N
×
log(
N
)
我们先暂时忽略其他操作的代价,因为它们与分析过的复杂度相比可忽略不计。之前查询 ...
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