Skip to Content
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
Explore Skills
Cloud Computing
Microsoft Azure
Amazon Web Services (AWS)
Google Cloud
Cloud Migration
Cloud Deployment
Cloud Platforms
Data Engineering
Data Warehouse
SQL
Apache Spark
Microsoft SQL Server
MySQL
Kafka
Data Lake
Streaming & Messaging
NoSQL Databases
Relational Databases
Data Science
Pandas
R
MATLAB
SAS
D3
Power BI
Tableau
Statistics
Exploratory Data Analysis
Data Visualization
AI & ML
Generative AI
Machine Learning
Artificial Intelligence (AI)
Deep Learning
Reinforcement Learning
Natural Language Processing
TensorFlow
Scikit-Learn
Hyperparameter Tuning
MLOps
Programming Languages
Java
JavaScript
Spring
Python
Go
C#
C++
C
Swift
Rust
Functional Programming
Software Architecture
Object-Oriented
Distributed Systems
Domain-Driven Design
Architectural Patterns
IT/Ops
Kubernetes
Docker
GitHub
Terraform
Continuous Delivery
Continuous Integration
Database Administration
Computer Networking
Operating Systems
IT Certifications
Security
Network Security
Application Security
Incident Response
Zero Trust Model
Disaster Recovery
Penetration Testing / Ethical Hacking
Governance
Malware
Security Architecture
Security Engineering
Security Certifications
Design
Web Design
Graphic Design
Interaction Design
Film & Video
User Experience (UX)
Design Process
Design Tools
Business
Agile
Project Management
Product Management
Marketing
Human Resources
Finance
Team Management
Business Strategy
Digital Transformation
Organizational Leadership
Soft Skills
Professional Communication
Emotional Intelligence
Presentation Skills
Innovation
Critical Thinking
Public Speaking
Collaboration
Personal Productivity
Confidence / Motivation
Features
All features
Verifiable skills
AI Academy
Courses
Certifications
Interactive learning
Live events
Superstreams
Answers
Insights reporting
Radar Blog
Buy Courses
Plans
Sign In
Try Now
O'Reilly Platform
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
的架构
|
55
会重复返回结果行(因此使用了去重聚合),以及变换可以正确地保留
IN
谓词的逻辑,该
逻辑可能返回三个值:
true
、
false
和
null
。
在这里,去重聚合使用与
Join
相同的分区方式,因此可以流式执行
,无须网络数据交换并
且使内存开销降到最低。
4.11
基于代价的优化器
4.8
节讲解了
Presto
的优化器如何将文本查询语句转化为可执行且优化过的查询计划;
4.9
节阐释了很多优化规则以及它们对提升查询性能的重要性;
4.10
节介绍了使查询计划可以
执行所必需的实现规则。
我们从接收用户查询开始,一直介绍到生成最终的执行计划。在这个过程中,我们浏览了
一些挑选出来的计划转换方法,这些重要的方法使计划执行的速度有了数量级的提升,甚
至让查询的执行变为可能。
现在让我们更深入地了解计划转换,它们在决策时不但基于查询本身的形状,而且更重要
的是,它们也将查询数据的形状考虑在内。这就是
Presto
先进的
基于代价的优化器
(
cost-
basedoptimizer
,
CBO
)所做的工作。
4.11.1
代价的概念
我们之前使用一个查询案例作为工作模型,为了方便易懂,这次也采用类似的方式。示例
4-8
是之前查询案例的变形,它移除了与本节内容无关的一些查询语句
。因此,我们可以
专注于查询优化器基于代价的决策。
示例
4-8
基于代价优化的查询案例
SELECT
n.name AS nation_name,
avg(extendedprice) as avg_price
FROM nation n, orders o, ...
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
数据库系统内幕
Alex Petrov
云原生:运用容器、函数计算和数据构建下一代应用
Boris Scholl, Trent Swanson, Peter Jausovec
Google系统架构解密: 构建安全可靠的系统
Heather Adkins, Betsy Beyer, Paul Blankinship, Piotr Lewandowski, Ana Oprea, Adam Stubblefield
Publisher Resources
ISBN: 9787115560056