Skip to Content
Amazon Redshift:权威指南
book

Amazon Redshift:权威指南

by Rajesh Francis, Rajiv Gupta, Milind Oke
May 2025
Intermediate to advanced
464 pages
6h 21m
Chinese
O'Reilly Media, Inc.
Content preview from Amazon Redshift:权威指南

第 5 章 扩展和性能优化 扩展和性能优化

本作品已使用人工智能进行翻译。欢迎您提供反馈和意见:translation-feedback@oreilly.com

如果我们告诉你,唯一不变的就是变化, ,那么我们很可能是在 "说教"。当今的挑战在于数据仓库适应变化的速度有多快。对于传统的数据仓库系统,这种变化往往会因为资源配置的准备时间而变得困难。有了 Amazon Redshift,无论是存储需求的变化还是计算需求的变化,适应变化都很容易。不会出现昂贵的错误决策,因为您可以根据需求的增减快速扩展。

扩展的目的是满足 工作负载的变化,以保持当前的性能水平和相关的 SLA。如果您在仓库中添加新的工作负载,那么现有工作负载的 SLA 就会受到影响;这就是扩展的意义所在。如果您分析的数据比以前更多,从而对工作负载 SLA 造成明显影响,也可能需要进行扩展。要使用 Amazon Redshift 实现扩展目标,有两个策略需要考虑:确保数据仓库的大小正确,以及确保工作负载的性能经过调整。

使用 Amazon Redshift,您可以通过纵向和横向扩展计算 来调整数据仓库的大小(见图 5-1)。垂直扩展是指通过增加对单个查询进行操作的计算来 "向上 "扩展。 向上扩展会导致 vCPU 或内存总数增加。如果您需要保留现有工作负载的 SLA,同时还要承担额外的工作负载,那么您通常会 "向上 "扩展数据仓库。当您的工作负载变化是可预测的,并允许您运行拉取大量行、处理更多连接和管理更长时间事务的大型查询时,通常会使用 "向上扩展"。横向扩展是指通过添加更多副本来 "向外 "扩展,以处理额外的工作负载。向外扩展时,每个查询都可能由从共享数据中读取的独立计算提供服务。向外扩展通常用于工作负载变化不可预测的情况,因为每个查询都会接收相同的计算,但系统可以处理更多并发工作负载。

在本章中,我们将向您展示如果您使用无服务器数据仓库或 RA3 预配置数据仓库,Amazon Redshift 将如何自动"扩展存储"。 此外,我们还将介绍对于无服务器数据仓库,Amazon Redshift 将如何根据工作负载向任一方向"自动扩展您的无服务器数据仓库";对于已配置数据仓库,您可以如何选择何时以及向哪个方向"扩展您的已配置数据仓库"。

Vertical versus horizontal scaling
图 5-1. 垂直与水平缩放

虽然确保 Amazon Redshift 数据仓库的大小正确非常重要,但 同样重要的是确保工作负载的性能得到调整。这些活动的结合将确保您充分利用资源,并获得最佳性能价格比。为了调整工作负载以提高性能,Amazon Redshift 中的许多功能都适用于无服务器数据仓库和已配置数据仓库。在本章中,我们将介绍一些最佳实践。 我们将介绍"WLM、队列和 QMR",这是预置数据仓库特有的功能。我们将向您展示"物化视图 "如何支持不同的访问模式,"自动经济学 "如何确保您的表得到良好维护,以及"工作负载隔离 "如何确保混合工作负载获得所需的计算能力。然后,我们将详细介绍查询是如何执行的,以及您应该如何考虑"查询调整"。 最后,我们将介绍一些"实现最佳价格和性能的附加优化"。

规模存储

第 2 章 "亚马逊 Redshift 入门 "中,我们介绍了 在使用无服务器或 RA3 配置数据仓库时,亚马逊 Redshift 如何由 RMS 提供支持。 ...

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

From ChatGPT to HackGPT: Meeting the Cybersecurity Threat of Generative AI

From ChatGPT to HackGPT: Meeting the Cybersecurity Threat of Generative AI

Karen Renaud, Merrill Warkentin, George Westerman
Three Essentials for Agentic AI Security

Three Essentials for Agentic AI Security

Paolo Dal Cin, Daniel Kendzior, Yusof Seedat, Renato Marinho

Publisher Resources

ISBN: 9798341658608